diff --git a/tidbits.xcodeproj/project.pbxproj b/tidbits.xcodeproj/project.pbxproj index 2ec5fc0..e4bdecf 100644 --- a/tidbits.xcodeproj/project.pbxproj +++ b/tidbits.xcodeproj/project.pbxproj @@ -10,7 +10,7 @@ 83460774248B248F006EBD71 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83460773248B248F006EBD71 /* AppDelegate.swift */; }; 83460776248B248F006EBD71 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83460775248B248F006EBD71 /* SceneDelegate.swift */; }; 83460779248B248F006EBD71 /* tidbits.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 83460777248B248F006EBD71 /* tidbits.xcdatamodeld */; }; - 8346077B248B248F006EBD71 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8346077A248B248F006EBD71 /* ContentView.swift */; }; + 8346077B248B248F006EBD71 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8346077A248B248F006EBD71 /* RootView.swift */; }; 8346077D248B2491006EBD71 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8346077C248B2491006EBD71 /* Assets.xcassets */; }; 83460780248B2491006EBD71 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8346077F248B2491006EBD71 /* Preview Assets.xcassets */; }; 83460783248B2491006EBD71 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83460781248B2491006EBD71 /* LaunchScreen.storyboard */; }; @@ -41,7 +41,7 @@ 83460773248B248F006EBD71 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 83460775248B248F006EBD71 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 83460778248B248F006EBD71 /* tidbits.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = tidbits.xcdatamodel; sourceTree = ""; }; - 8346077A248B248F006EBD71 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 8346077A248B248F006EBD71 /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; 8346077C248B2491006EBD71 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 8346077F248B2491006EBD71 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 83460782248B2491006EBD71 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -103,14 +103,14 @@ 83460772248B248F006EBD71 /* tidbits */ = { isa = PBXGroup; children = ( + 83987CC0248C399900BA9FFE /* views */, + 83987CBF248C396000BA9FFE /* model */, 83460773248B248F006EBD71 /* AppDelegate.swift */, 83460775248B248F006EBD71 /* SceneDelegate.swift */, - 83987CBC248C25D000BA9FFE /* CardView.swift */, - 8346077A248B248F006EBD71 /* ContentView.swift */, + 8346077A248B248F006EBD71 /* RootView.swift */, 8346077C248B2491006EBD71 /* Assets.xcassets */, 83460781248B2491006EBD71 /* LaunchScreen.storyboard */, 83460784248B2491006EBD71 /* Info.plist */, - 83460777248B248F006EBD71 /* tidbits.xcdatamodeld */, 8346077E248B2491006EBD71 /* Preview Content */, ); path = tidbits; @@ -142,6 +142,38 @@ path = tidbitsUITests; sourceTree = ""; }; + 83987CBF248C396000BA9FFE /* model */ = { + isa = PBXGroup; + children = ( + 83460777248B248F006EBD71 /* tidbits.xcdatamodeld */, + ); + path = model; + sourceTree = ""; + }; + 83987CC0248C399900BA9FFE /* views */ = { + isa = PBXGroup; + children = ( + 83987CC2248C39EE00BA9FFE /* components */, + 83987CC1248C39AF00BA9FFE /* screens */, + ); + path = views; + sourceTree = ""; + }; + 83987CC1248C39AF00BA9FFE /* screens */ = { + isa = PBXGroup; + children = ( + ); + path = screens; + sourceTree = ""; + }; + 83987CC2248C39EE00BA9FFE /* components */ = { + isa = PBXGroup; + children = ( + 83987CBC248C25D000BA9FFE /* CardView.swift */, + ); + path = components; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -296,7 +328,7 @@ files = ( 83460774248B248F006EBD71 /* AppDelegate.swift in Sources */, 83460776248B248F006EBD71 /* SceneDelegate.swift in Sources */, - 8346077B248B248F006EBD71 /* ContentView.swift in Sources */, + 8346077B248B248F006EBD71 /* RootView.swift in Sources */, 83460779248B248F006EBD71 /* tidbits.xcdatamodeld in Sources */, 83987CBD248C25D000BA9FFE /* CardView.swift in Sources */, ); diff --git a/tidbits/ContentView.swift b/tidbits/ContentView.swift index d26f220..7936e60 100644 --- a/tidbits/ContentView.swift +++ b/tidbits/ContentView.swift @@ -8,7 +8,7 @@ import SwiftUI -struct ContentView: View { +struct RootView: View { var body: some View { NavigationView { VStack { @@ -32,6 +32,6 @@ struct ContentView: View { struct ContentView_Previews: PreviewProvider { static var previews: some View { - ContentView() + RootView() } } diff --git a/tidbits/RootView.swift b/tidbits/RootView.swift new file mode 100644 index 0000000..7936e60 --- /dev/null +++ b/tidbits/RootView.swift @@ -0,0 +1,37 @@ +// +// ContentView.swift +// tidbits +// +// Created by Chris Vanderloo on 6/5/20. +// Copyright © 2020 Chris Vanderloo. All rights reserved. +// + +import SwiftUI + +struct RootView: View { + var body: some View { + NavigationView { + VStack { + ScrollView { + VStack { + CardView(a: 1) + } + } + HStack { + Spacer() + Button(action: { }) { + Circle() + } + .padding([.bottom, .trailing]) + .frame(width: 88, height: 88) + } + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + RootView() + } +} diff --git a/tidbits/SceneDelegate.swift b/tidbits/SceneDelegate.swift index aa7baa6..67fb057 100644 --- a/tidbits/SceneDelegate.swift +++ b/tidbits/SceneDelegate.swift @@ -24,7 +24,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // Create the SwiftUI view and set the context as the value for the managedObjectContext environment keyPath. // Add `@Environment(\.managedObjectContext)` in the views that will need the context. - let contentView = ContentView().environment(\.managedObjectContext, context) + let contentView = RootView().environment(\.managedObjectContext, context) // Use a UIHostingController as window root view controller. if let windowScene = scene as? UIWindowScene { diff --git a/tidbits/tidbits.xcdatamodeld/.xccurrentversion b/tidbits/model/tidbits.xcdatamodeld/.xccurrentversion similarity index 100% rename from tidbits/tidbits.xcdatamodeld/.xccurrentversion rename to tidbits/model/tidbits.xcdatamodeld/.xccurrentversion diff --git a/tidbits/tidbits.xcdatamodeld/tidbits.xcdatamodel/contents b/tidbits/model/tidbits.xcdatamodeld/tidbits.xcdatamodel/contents similarity index 100% rename from tidbits/tidbits.xcdatamodeld/tidbits.xcdatamodel/contents rename to tidbits/model/tidbits.xcdatamodeld/tidbits.xcdatamodel/contents diff --git a/tidbits/CardView.swift b/tidbits/views/components/CardView.swift similarity index 100% rename from tidbits/CardView.swift rename to tidbits/views/components/CardView.swift