Source code for the WriteFreely SwiftUI app for iOS, iPadOS, and macOS
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SidebarView.swift 914 B

12345678910111213141516171819202122232425
  1. import SwiftUI
  2. struct SidebarView: View {
  3. var body: some View {
  4. CollectionListView()
  5. }
  6. }
  7. struct SidebarView_Previews: PreviewProvider {
  8. static var previews: some View {
  9. let userCollection1 = WFACollection(context: PersistenceManager.persistentContainer.viewContext)
  10. let userCollection2 = WFACollection(context: PersistenceManager.persistentContainer.viewContext)
  11. let userCollection3 = WFACollection(context: PersistenceManager.persistentContainer.viewContext)
  12. userCollection1.title = "Collection 1"
  13. userCollection2.title = "Collection 2"
  14. userCollection3.title = "Collection 3"
  15. let model = WriteFreelyModel()
  16. model.collections = CollectionListModel()
  17. return SidebarView()
  18. .environmentObject(model)
  19. .environment(\.managedObjectContext, PersistenceManager.persistentContainer.viewContext)
  20. }
  21. }