├── README.md ├── Todo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── jordansinger.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── jordansinger.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── Todo ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── ContentView.swift ├── Info.plist ├── Preview Content └── Preview Assets.xcassets │ └── Contents.json ├── Todo.entitlements └── TodoApp.swift /README.md: -------------------------------------------------------------------------------- 1 | Todo macOS app in built SwiftUI 2 | ![Todo](https://user-images.githubusercontent.com/110813/88483154-ff327500-cf33-11ea-8d37-cda60b92818e.png) 3 | -------------------------------------------------------------------------------- /Todo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 86EE02A524B3E84200D1762E /* TodoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86EE02A424B3E84200D1762E /* TodoApp.swift */; }; 11 | 86EE02A724B3E84200D1762E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86EE02A624B3E84200D1762E /* ContentView.swift */; }; 12 | 86EE02A924B3E84400D1762E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 86EE02A824B3E84400D1762E /* Assets.xcassets */; }; 13 | 86EE02AC24B3E84400D1762E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 86EE02AB24B3E84400D1762E /* Preview Assets.xcassets */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 86EE02A124B3E84200D1762E /* Todo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Todo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | 86EE02A424B3E84200D1762E /* TodoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoApp.swift; sourceTree = ""; }; 19 | 86EE02A624B3E84200D1762E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 20 | 86EE02A824B3E84400D1762E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 21 | 86EE02AB24B3E84400D1762E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 22 | 86EE02AD24B3E84400D1762E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | 86EE02AE24B3E84400D1762E /* Todo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Todo.entitlements; sourceTree = ""; }; 24 | /* End PBXFileReference section */ 25 | 26 | /* Begin PBXFrameworksBuildPhase section */ 27 | 86EE029E24B3E84200D1762E /* Frameworks */ = { 28 | isa = PBXFrameworksBuildPhase; 29 | buildActionMask = 2147483647; 30 | files = ( 31 | ); 32 | runOnlyForDeploymentPostprocessing = 0; 33 | }; 34 | /* End PBXFrameworksBuildPhase section */ 35 | 36 | /* Begin PBXGroup section */ 37 | 86EE029824B3E84200D1762E = { 38 | isa = PBXGroup; 39 | children = ( 40 | 86EE02A324B3E84200D1762E /* Todo */, 41 | 86EE02A224B3E84200D1762E /* Products */, 42 | ); 43 | sourceTree = ""; 44 | }; 45 | 86EE02A224B3E84200D1762E /* Products */ = { 46 | isa = PBXGroup; 47 | children = ( 48 | 86EE02A124B3E84200D1762E /* Todo.app */, 49 | ); 50 | name = Products; 51 | sourceTree = ""; 52 | }; 53 | 86EE02A324B3E84200D1762E /* Todo */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 86EE02A424B3E84200D1762E /* TodoApp.swift */, 57 | 86EE02A624B3E84200D1762E /* ContentView.swift */, 58 | 86EE02A824B3E84400D1762E /* Assets.xcassets */, 59 | 86EE02AD24B3E84400D1762E /* Info.plist */, 60 | 86EE02AE24B3E84400D1762E /* Todo.entitlements */, 61 | 86EE02AA24B3E84400D1762E /* Preview Content */, 62 | ); 63 | path = Todo; 64 | sourceTree = ""; 65 | }; 66 | 86EE02AA24B3E84400D1762E /* Preview Content */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 86EE02AB24B3E84400D1762E /* Preview Assets.xcassets */, 70 | ); 71 | path = "Preview Content"; 72 | sourceTree = ""; 73 | }; 74 | /* End PBXGroup section */ 75 | 76 | /* Begin PBXNativeTarget section */ 77 | 86EE02A024B3E84200D1762E /* Todo */ = { 78 | isa = PBXNativeTarget; 79 | buildConfigurationList = 86EE02B124B3E84400D1762E /* Build configuration list for PBXNativeTarget "Todo" */; 80 | buildPhases = ( 81 | 86EE029D24B3E84200D1762E /* Sources */, 82 | 86EE029E24B3E84200D1762E /* Frameworks */, 83 | 86EE029F24B3E84200D1762E /* Resources */, 84 | ); 85 | buildRules = ( 86 | ); 87 | dependencies = ( 88 | ); 89 | name = Todo; 90 | productName = Todo; 91 | productReference = 86EE02A124B3E84200D1762E /* Todo.app */; 92 | productType = "com.apple.product-type.application"; 93 | }; 94 | /* End PBXNativeTarget section */ 95 | 96 | /* Begin PBXProject section */ 97 | 86EE029924B3E84200D1762E /* Project object */ = { 98 | isa = PBXProject; 99 | attributes = { 100 | LastSwiftUpdateCheck = 1200; 101 | LastUpgradeCheck = 1200; 102 | TargetAttributes = { 103 | 86EE02A024B3E84200D1762E = { 104 | CreatedOnToolsVersion = 12.0; 105 | }; 106 | }; 107 | }; 108 | buildConfigurationList = 86EE029C24B3E84200D1762E /* Build configuration list for PBXProject "Todo" */; 109 | compatibilityVersion = "Xcode 9.3"; 110 | developmentRegion = en; 111 | hasScannedForEncodings = 0; 112 | knownRegions = ( 113 | en, 114 | Base, 115 | ); 116 | mainGroup = 86EE029824B3E84200D1762E; 117 | productRefGroup = 86EE02A224B3E84200D1762E /* Products */; 118 | projectDirPath = ""; 119 | projectRoot = ""; 120 | targets = ( 121 | 86EE02A024B3E84200D1762E /* Todo */, 122 | ); 123 | }; 124 | /* End PBXProject section */ 125 | 126 | /* Begin PBXResourcesBuildPhase section */ 127 | 86EE029F24B3E84200D1762E /* Resources */ = { 128 | isa = PBXResourcesBuildPhase; 129 | buildActionMask = 2147483647; 130 | files = ( 131 | 86EE02AC24B3E84400D1762E /* Preview Assets.xcassets in Resources */, 132 | 86EE02A924B3E84400D1762E /* Assets.xcassets in Resources */, 133 | ); 134 | runOnlyForDeploymentPostprocessing = 0; 135 | }; 136 | /* End PBXResourcesBuildPhase section */ 137 | 138 | /* Begin PBXSourcesBuildPhase section */ 139 | 86EE029D24B3E84200D1762E /* Sources */ = { 140 | isa = PBXSourcesBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | 86EE02A724B3E84200D1762E /* ContentView.swift in Sources */, 144 | 86EE02A524B3E84200D1762E /* TodoApp.swift in Sources */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXSourcesBuildPhase section */ 149 | 150 | /* Begin XCBuildConfiguration section */ 151 | 86EE02AF24B3E84400D1762E /* Debug */ = { 152 | isa = XCBuildConfiguration; 153 | buildSettings = { 154 | ALWAYS_SEARCH_USER_PATHS = NO; 155 | CLANG_ANALYZER_NONNULL = YES; 156 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 157 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 158 | CLANG_CXX_LIBRARY = "libc++"; 159 | CLANG_ENABLE_MODULES = YES; 160 | CLANG_ENABLE_OBJC_ARC = YES; 161 | CLANG_ENABLE_OBJC_WEAK = YES; 162 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 163 | CLANG_WARN_BOOL_CONVERSION = YES; 164 | CLANG_WARN_COMMA = YES; 165 | CLANG_WARN_CONSTANT_CONVERSION = YES; 166 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 167 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 168 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 169 | CLANG_WARN_EMPTY_BODY = YES; 170 | CLANG_WARN_ENUM_CONVERSION = YES; 171 | CLANG_WARN_INFINITE_RECURSION = YES; 172 | CLANG_WARN_INT_CONVERSION = YES; 173 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 174 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 175 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 176 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 177 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 178 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 179 | CLANG_WARN_STRICT_PROTOTYPES = YES; 180 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 181 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 182 | CLANG_WARN_UNREACHABLE_CODE = YES; 183 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 184 | COPY_PHASE_STRIP = NO; 185 | DEBUG_INFORMATION_FORMAT = dwarf; 186 | ENABLE_STRICT_OBJC_MSGSEND = YES; 187 | ENABLE_TESTABILITY = YES; 188 | GCC_C_LANGUAGE_STANDARD = gnu11; 189 | GCC_DYNAMIC_NO_PIC = NO; 190 | GCC_NO_COMMON_BLOCKS = YES; 191 | GCC_OPTIMIZATION_LEVEL = 0; 192 | GCC_PREPROCESSOR_DEFINITIONS = ( 193 | "DEBUG=1", 194 | "$(inherited)", 195 | ); 196 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 197 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 198 | GCC_WARN_UNDECLARED_SELECTOR = YES; 199 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 200 | GCC_WARN_UNUSED_FUNCTION = YES; 201 | GCC_WARN_UNUSED_VARIABLE = YES; 202 | MACOSX_DEPLOYMENT_TARGET = 10.16; 203 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 204 | MTL_FAST_MATH = YES; 205 | ONLY_ACTIVE_ARCH = YES; 206 | SDKROOT = macosx; 207 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 208 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 209 | }; 210 | name = Debug; 211 | }; 212 | 86EE02B024B3E84400D1762E /* Release */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | CLANG_ANALYZER_NONNULL = YES; 217 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_ENABLE_OBJC_WEAK = YES; 223 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 224 | CLANG_WARN_BOOL_CONVERSION = YES; 225 | CLANG_WARN_COMMA = YES; 226 | CLANG_WARN_CONSTANT_CONVERSION = YES; 227 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 228 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 229 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 230 | CLANG_WARN_EMPTY_BODY = YES; 231 | CLANG_WARN_ENUM_CONVERSION = YES; 232 | CLANG_WARN_INFINITE_RECURSION = YES; 233 | CLANG_WARN_INT_CONVERSION = YES; 234 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 235 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 236 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 237 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 238 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 239 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 240 | CLANG_WARN_STRICT_PROTOTYPES = YES; 241 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 242 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 243 | CLANG_WARN_UNREACHABLE_CODE = YES; 244 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 245 | COPY_PHASE_STRIP = NO; 246 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 247 | ENABLE_NS_ASSERTIONS = NO; 248 | ENABLE_STRICT_OBJC_MSGSEND = YES; 249 | GCC_C_LANGUAGE_STANDARD = gnu11; 250 | GCC_NO_COMMON_BLOCKS = YES; 251 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 252 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 253 | GCC_WARN_UNDECLARED_SELECTOR = YES; 254 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 255 | GCC_WARN_UNUSED_FUNCTION = YES; 256 | GCC_WARN_UNUSED_VARIABLE = YES; 257 | MACOSX_DEPLOYMENT_TARGET = 10.16; 258 | MTL_ENABLE_DEBUG_INFO = NO; 259 | MTL_FAST_MATH = YES; 260 | SDKROOT = macosx; 261 | SWIFT_COMPILATION_MODE = wholemodule; 262 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 263 | }; 264 | name = Release; 265 | }; 266 | 86EE02B224B3E84400D1762E /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 270 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 271 | CODE_SIGN_ENTITLEMENTS = Todo/Todo.entitlements; 272 | CODE_SIGN_STYLE = Automatic; 273 | COMBINE_HIDPI_IMAGES = YES; 274 | DEVELOPMENT_ASSET_PATHS = "\"Todo/Preview Content\""; 275 | ENABLE_PREVIEWS = YES; 276 | INFOPLIST_FILE = Todo/Info.plist; 277 | LD_RUNPATH_SEARCH_PATHS = ( 278 | "$(inherited)", 279 | "@executable_path/../Frameworks", 280 | ); 281 | MACOSX_DEPLOYMENT_TARGET = 10.16; 282 | PRODUCT_BUNDLE_IDENTIFIER = example.Todo; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | SWIFT_VERSION = 5.0; 285 | }; 286 | name = Debug; 287 | }; 288 | 86EE02B324B3E84400D1762E /* Release */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 292 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 293 | CODE_SIGN_ENTITLEMENTS = Todo/Todo.entitlements; 294 | CODE_SIGN_STYLE = Automatic; 295 | COMBINE_HIDPI_IMAGES = YES; 296 | DEVELOPMENT_ASSET_PATHS = "\"Todo/Preview Content\""; 297 | ENABLE_PREVIEWS = YES; 298 | INFOPLIST_FILE = Todo/Info.plist; 299 | LD_RUNPATH_SEARCH_PATHS = ( 300 | "$(inherited)", 301 | "@executable_path/../Frameworks", 302 | ); 303 | MACOSX_DEPLOYMENT_TARGET = 10.16; 304 | PRODUCT_BUNDLE_IDENTIFIER = example.Todo; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | SWIFT_VERSION = 5.0; 307 | }; 308 | name = Release; 309 | }; 310 | /* End XCBuildConfiguration section */ 311 | 312 | /* Begin XCConfigurationList section */ 313 | 86EE029C24B3E84200D1762E /* Build configuration list for PBXProject "Todo" */ = { 314 | isa = XCConfigurationList; 315 | buildConfigurations = ( 316 | 86EE02AF24B3E84400D1762E /* Debug */, 317 | 86EE02B024B3E84400D1762E /* Release */, 318 | ); 319 | defaultConfigurationIsVisible = 0; 320 | defaultConfigurationName = Release; 321 | }; 322 | 86EE02B124B3E84400D1762E /* Build configuration list for PBXNativeTarget "Todo" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | 86EE02B224B3E84400D1762E /* Debug */, 326 | 86EE02B324B3E84400D1762E /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | /* End XCConfigurationList section */ 332 | }; 333 | rootObject = 86EE029924B3E84200D1762E /* Project object */; 334 | } 335 | -------------------------------------------------------------------------------- /Todo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Todo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Todo.xcodeproj/project.xcworkspace/xcuserdata/jordansinger.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jordansinger/todo-macos-swiftui-sample/e325131112bf007f67020424d5646da421952907/Todo.xcodeproj/project.xcworkspace/xcuserdata/jordansinger.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Todo.xcodeproj/xcuserdata/jordansinger.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Todo.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Todo/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "1.000", 9 | "green" : "1.000", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Todo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Todo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Todo/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Todo 4 | // 5 | // Created by Jordan Singer on 7/6/20. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct Task: Hashable, Identifiable { 11 | var id = UUID() 12 | var title: String 13 | var completed = false 14 | } 15 | 16 | struct ContentView: View { 17 | @State var selection: Set = [0] 18 | 19 | var body: some View { 20 | NavigationView { 21 | List(selection: self.$selection) { 22 | Label("Tasks", systemImage: "largecircle.fill.circle") 23 | .tag(0) 24 | Label("Today", systemImage: "star.fill") 25 | Label("Upcoming", systemImage: "calendar") 26 | 27 | Divider() 28 | 29 | Label("Activity", systemImage: "clock.fill") 30 | Label("Trash", systemImage: "trash.fill") 31 | 32 | Divider() 33 | 34 | Label("New List", systemImage: "plus") 35 | } 36 | .listStyle(SidebarListStyle()) 37 | .frame(minWidth: 100, idealWidth: 150, maxWidth: 200, maxHeight: .infinity) 38 | 39 | TasksView() 40 | } 41 | } 42 | } 43 | 44 | struct TasksView: View { 45 | @State var tasks = [ 46 | Task(title: "Here’s to the crazy ones"), 47 | Task(title: "the misfits, the rebels, the troublemakers", completed: true), 48 | Task(title: "the round pegs in the square holes…"), 49 | Task(title: "the ones who see things differently — they’re not fond of rules…"), 50 | Task(title: "You can quote them, disagree with them, glorify or vilify them"), 51 | Task(title: "but the only thing you can’t do is ignore them because they change things…"), 52 | Task(title: "they push the human race forward", completed: true), 53 | Task(title: "and while some may see them as the crazy ones"), 54 | Task(title: "we see genius", completed: true), 55 | Task(title: "because the ones who are crazy enough to think that they can change the world"), 56 | Task(title: "are the ones who do.") 57 | ] 58 | 59 | var body: some View { 60 | List { 61 | VStack(alignment: .leading, spacing: 12) { 62 | Text("Tasks") 63 | .font(.headline) 64 | ForEach(tasks, id: \.id) { task in 65 | TaskView(task: task) 66 | } 67 | } 68 | } 69 | .navigationTitle("Todo") 70 | .toolbar { 71 | ToolbarItem(placement: .status) { 72 | Button(action: { tasks.append(Task(title: "New task")) }) { 73 | Image(systemName: "plus") 74 | } 75 | } 76 | 77 | } 78 | } 79 | } 80 | 81 | struct TaskView: View { 82 | @State var task: Task 83 | 84 | var body: some View { 85 | Button(action: { task.completed.toggle() }) { 86 | HStack(alignment: .firstTextBaseline, spacing: 8) { 87 | Image(systemName: task.completed ? "largecircle.fill.circle" : "circle") 88 | .foregroundColor(.secondary) 89 | Text(task.title) 90 | .strikethrough(task.completed) 91 | .foregroundColor(task.completed ? .secondary : .primary) 92 | Spacer() 93 | } 94 | } 95 | .buttonStyle(PlainButtonStyle()) 96 | } 97 | } 98 | 99 | struct ContentView_Previews: PreviewProvider { 100 | static var previews: some View { 101 | ContentView() 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Todo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSMinimumSystemVersion 22 | $(MACOSX_DEPLOYMENT_TARGET) 23 | 24 | 25 | -------------------------------------------------------------------------------- /Todo/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Todo/Todo.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Todo/TodoApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TodoApp.swift 3 | // Todo 4 | // 5 | // Created by Jordan Singer on 7/6/20. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct TodoApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | --------------------------------------------------------------------------------