From 533e819cb5749656a3e6f7a689c0fff56ba6982c Mon Sep 17 00:00:00 2001 From: angiemugo Date: Thu, 18 Jan 2018 19:02:34 +0300 Subject: [PATCH] refactors to MVC --- MyToDo.xcodeproj/project.pbxproj | 38 +---- .../UserInterfaceState.xcuserstate | Bin 0 -> 22002 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 + MyToDo/AppDelegate.swift | 25 ++- .../AppIcon.appiconset/Contents.json | 5 + MyToDo/Assets.xcassets/Contents.json | 6 + .../Image.imageset/Contents.json | 23 +++ ...a36427a4-43e0-4bff-9f67-2d0aec6e76e1-1.png | Bin 0 -> 4149 bytes ...a36427a4-43e0-4bff-9f67-2d0aec6e76e1-2.png | Bin 0 -> 4149 bytes .../a36427a4-43e0-4bff-9f67-2d0aec6e76e1.png | Bin 0 -> 4149 bytes MyToDo/Base.lproj/LaunchScreen.storyboard | 25 --- MyToDo/Base.lproj/Main.storyboard | 80 ++++++++-- MyToDo/Info.plist | 2 +- MyToDo/ItemTableViewController.swift | 148 ++++++++++++++++++ MyToDo/ToDoItem.swift | 38 +++++ MyToDo/ViewController.swift | 25 --- MyToDoTests/Info.plist | 22 --- MyToDoTests/MyToDoTests.swift | 36 ----- 18 files changed, 314 insertions(+), 164 deletions(-) create mode 100644 MyToDo.xcodeproj/project.xcworkspace/xcuserdata/Angie.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 MyToDo.xcodeproj/xcuserdata/Angie.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist create mode 100644 MyToDo/Assets.xcassets/Contents.json create mode 100644 MyToDo/Assets.xcassets/Image.imageset/Contents.json create mode 100644 MyToDo/Assets.xcassets/Image.imageset/a36427a4-43e0-4bff-9f67-2d0aec6e76e1-1.png create mode 100644 MyToDo/Assets.xcassets/Image.imageset/a36427a4-43e0-4bff-9f67-2d0aec6e76e1-2.png create mode 100644 MyToDo/Assets.xcassets/Image.imageset/a36427a4-43e0-4bff-9f67-2d0aec6e76e1.png delete mode 100644 MyToDo/Base.lproj/LaunchScreen.storyboard create mode 100644 MyToDo/ItemTableViewController.swift create mode 100644 MyToDo/ToDoItem.swift delete mode 100644 MyToDo/ViewController.swift delete mode 100644 MyToDoTests/Info.plist delete mode 100644 MyToDoTests/MyToDoTests.swift diff --git a/MyToDo.xcodeproj/project.pbxproj b/MyToDo.xcodeproj/project.pbxproj index 67d7aaf..68c567d 100644 --- a/MyToDo.xcodeproj/project.pbxproj +++ b/MyToDo.xcodeproj/project.pbxproj @@ -8,11 +8,10 @@ /* Begin PBXBuildFile section */ FDB90350200F214B00B7874B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB9034F200F214B00B7874B /* AppDelegate.swift */; }; - FDB90352200F214B00B7874B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB90351200F214B00B7874B /* ViewController.swift */; }; FDB90355200F214B00B7874B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDB90353200F214B00B7874B /* Main.storyboard */; }; FDB90357200F214B00B7874B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDB90356200F214B00B7874B /* Assets.xcassets */; }; - FDB9035A200F214B00B7874B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDB90358200F214B00B7874B /* LaunchScreen.storyboard */; }; - FDB90365200F214B00B7874B /* MyToDoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB90364200F214B00B7874B /* MyToDoTests.swift */; }; + FDB90370200F22CA00B7874B /* ToDoItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB9036F200F22CA00B7874B /* ToDoItem.swift */; }; + FDB90372200F23ED00B7874B /* ItemTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB90371200F23ED00B7874B /* ItemTableViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -28,14 +27,12 @@ /* Begin PBXFileReference section */ FDB9034C200F214B00B7874B /* MyToDo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyToDo.app; sourceTree = BUILT_PRODUCTS_DIR; }; FDB9034F200F214B00B7874B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - FDB90351200F214B00B7874B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; FDB90354200F214B00B7874B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; FDB90356200F214B00B7874B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - FDB90359200F214B00B7874B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; FDB9035B200F214B00B7874B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FDB90360200F214B00B7874B /* MyToDoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyToDoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - FDB90364200F214B00B7874B /* MyToDoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyToDoTests.swift; sourceTree = ""; }; - FDB90366200F214B00B7874B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FDB9036F200F22CA00B7874B /* ToDoItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoItem.swift; sourceTree = ""; }; + FDB90371200F23ED00B7874B /* ItemTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemTableViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,7 +57,6 @@ isa = PBXGroup; children = ( FDB9034E200F214B00B7874B /* MyToDo */, - FDB90363200F214B00B7874B /* MyToDoTests */, FDB9034D200F214B00B7874B /* Products */, ); sourceTree = ""; @@ -78,24 +74,15 @@ isa = PBXGroup; children = ( FDB9034F200F214B00B7874B /* AppDelegate.swift */, - FDB90351200F214B00B7874B /* ViewController.swift */, FDB90353200F214B00B7874B /* Main.storyboard */, FDB90356200F214B00B7874B /* Assets.xcassets */, - FDB90358200F214B00B7874B /* LaunchScreen.storyboard */, FDB9035B200F214B00B7874B /* Info.plist */, + FDB9036F200F22CA00B7874B /* ToDoItem.swift */, + FDB90371200F23ED00B7874B /* ItemTableViewController.swift */, ); path = MyToDo; sourceTree = ""; }; - FDB90363200F214B00B7874B /* MyToDoTests */ = { - isa = PBXGroup; - children = ( - FDB90364200F214B00B7874B /* MyToDoTests.swift */, - FDB90366200F214B00B7874B /* Info.plist */, - ); - path = MyToDoTests; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -179,7 +166,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDB9035A200F214B00B7874B /* LaunchScreen.storyboard in Resources */, FDB90357200F214B00B7874B /* Assets.xcassets in Resources */, FDB90355200F214B00B7874B /* Main.storyboard in Resources */, ); @@ -199,8 +185,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDB90352200F214B00B7874B /* ViewController.swift in Sources */, FDB90350200F214B00B7874B /* AppDelegate.swift in Sources */, + FDB90372200F23ED00B7874B /* ItemTableViewController.swift in Sources */, + FDB90370200F22CA00B7874B /* ToDoItem.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -208,7 +195,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - FDB90365200F214B00B7874B /* MyToDoTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -231,14 +217,6 @@ name = Main.storyboard; sourceTree = ""; }; - FDB90358200F214B00B7874B /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - FDB90359200F214B00B7874B /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/MyToDo.xcodeproj/project.xcworkspace/xcuserdata/Angie.xcuserdatad/UserInterfaceState.xcuserstate b/MyToDo.xcodeproj/project.xcworkspace/xcuserdata/Angie.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..57b06f8acde4c03aad7e1d547eb67ee3471802cf GIT binary patch literal 22002 zcmeHvcU)7~`|vq;#K8(-CJ+cDYyu$=5;kFqiUSZ4QH&5E3Ivm&QmdZZ+GY3f+i5Gf zYHM3tyLW4AwY!d1JFFenwszQU_xqfCNdUF|weRQqzJLA7rzW}QoadbLJkNRdxeNQc z9d3`oZ~$S%AQo|mM>3g5*59OCYInIE&fX@SbKxR;o5wvzXLGf6IpA@F&g1M;AbjD5 zdxG)LXdD`kLQp6QLkTDmC81=Lf>Kc$%0#)yj4UV*O-D1(OjL*JQ3INV8qsXjgnE$^ z^`Rxmh1|%4`q5If46R0&qIKv$=q9uQtwn=qGrApZL-(K^=zjDtdICLzo=1DpYv^_K zCVC5ffIdVYp^wq0=oj=W`VIY#{y=|XgfV7tAP&NE9E=q>5-V{GPR1!X6{q2Jtj7kN zj|*@iF2QBE99QF7JPkME*|-VM!Ogf8w_ykF!Ar0UyYVu-91q~t_&j_ez6f87ufyx` zfAIBqBi@8J<1KhAz60;T_u>cf)A$+uEPffkf-c6d;sf{~K8)YTALFm^*Z3s<1^XhzMXG3kt+$zU=W15?UanKGuFsbDIZDrPEE%hWRsObauQna{K`c4jfN zgz0BiGOL)?%%#j_%;n4#%$3Yl%+<_#W)riS*~Z+#+{xU->|mZ|o?)J4b}`Q}&ojH3 zeawF50CSLelX;tYhk2hl%6!Fq&75R@V18tNVG)bj@vJ`^zy`Al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EH##zN-d@NrER5Gmp)OtyY!XP z1En97ep-5>^sCZuN>7#kTKb0-TUo2WHP9Mrjk6|O)2tcREUU#@U@f*xA#Ypu1} zYO}UmJFSbXOROI2GV3|kbFCLxFSD+zJXrZw<;RuZRDNIiQ{^v}zgM9uwn|S7} zr&gy|o2o6<`PGHhmDTXVvg(=D^Q#wBw^eskJF2^@oz+XKS5=eh^QteXexv$G_0j4N ztB*~JpOiT%Yf|>4+(}C(oj>V + + diff --git a/MyToDo/AppDelegate.swift b/MyToDo/AppDelegate.swift index a421676..ed4e7bb 100644 --- a/MyToDo/AppDelegate.swift +++ b/MyToDo/AppDelegate.swift @@ -10,37 +10,36 @@ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - + + var window: UIWindow? + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. return true } - + func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } - + func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - + func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } - + func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } - - + + } diff --git a/MyToDo/Assets.xcassets/AppIcon.appiconset/Contents.json b/MyToDo/Assets.xcassets/AppIcon.appiconset/Contents.json index 1d060ed..d8db8d6 100644 --- a/MyToDo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/MyToDo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -84,6 +84,11 @@ "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/MyToDo/Assets.xcassets/Contents.json b/MyToDo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/MyToDo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/MyToDo/Assets.xcassets/Image.imageset/Contents.json b/MyToDo/Assets.xcassets/Image.imageset/Contents.json new file mode 100644 index 0000000..ca1dc89 --- /dev/null +++ b/MyToDo/Assets.xcassets/Image.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "a36427a4-43e0-4bff-9f67-2d0aec6e76e1-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "a36427a4-43e0-4bff-9f67-2d0aec6e76e1-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "a36427a4-43e0-4bff-9f67-2d0aec6e76e1.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/MyToDo/Assets.xcassets/Image.imageset/a36427a4-43e0-4bff-9f67-2d0aec6e76e1-1.png b/MyToDo/Assets.xcassets/Image.imageset/a36427a4-43e0-4bff-9f67-2d0aec6e76e1-1.png new file mode 100644 index 0000000000000000000000000000000000000000..772acd7ef064871f585b8ee66e0fa53ef9d45af6 GIT binary patch literal 4149 zcmdT{XH*l)woYh4LXnOlf>aSfL8OQRhu#IjL+=p4fT1RILQz5RA}9z_RisG?C_O-q zbO|6WgdRW<3=nEU2<682`>nU$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=KhB;q}wr{4*QO8QU;;~YuGCxa1uUDJ9WJO)IWe17pCu?`}srG?O=RETAw)7 zkHZeKb6ei2bvVN1L=B~oH`wRFI;{8H|9@=iVjKusT{TihjHo#WhOdiQG_`T_A8xf$wP>_{nU%7KEo36oz$ZORI3JCuv2-*`LUpvV(q{ycDDli%z-xLqLJ0zxXhuS68GG0vDdM&Y9rolGXyek?*Q@6kyq9< zq3fat@3uaZ^HcS?4x2_r$}-lw!gW)lPUN2*lyNPKeEbcF9duX)(5k%C8-9JsD#-BK zto|H9dLxMX088dAd+Mh~o3FiHo+v6lgEEFJ`zd9l8q`)e`BVs`yh>0=Yb zb0cy6%lvDLS&o4pxp2TNJ9%%Qx+`l|7|oryHp=R&v_?p(`{o0*c1H8-%`Xtne9*YewxGOR90MQo@1?MaTknstX9 zzwhW%xwxM=w&d!3QXcaO8ahF;XtXW=^y4$sjQJ%?)va8Du7`V!2bkMlG ziN4>Xk*Tay%@cDPvwkE>rC6PHjBz2P0*tfxUS6|@f{;a2uDFrTT4gbbuJ5KG+ZXvK znm-ob#OmV?s>@AgGOx*s{qphB@_G?>wr90xsGzHS^qg(>gr?t{PaT*^J)yZCQa&bf z{>t(z`%(?}#P-)pq&+sRv>CloZDc=^eN5wn#n>4h&vd#5q*0k}4mr@8FkJDqE6(YW z9~4Wua$cySiHc|HvpbwpO^gU3&oNAa=ft+;!awl_gji3r%Oni2d+i&AS9)Uw>%LIF zd)H`SUj<#4B5=4av|0OeW5=${WHlya;x2ej<2N-<{n6=XjIqgZ;^AOSP+H@u;-B1f zoNE%}Vi;F%ldI>h)jEqF_!6~EW{h<@@`47`DneuyEYm~CT2&1r7d&GH4|UO3uBX4o z(yTqPw=kr`y~|CwQ)0RF77Hgqgz3-~Z5hLsV?4mWS>52O*o$VZ>LRLWC900u4qI1& z - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MyToDo/Base.lproj/Main.storyboard b/MyToDo/Base.lproj/Main.storyboard index 03c13c2..18184ba 100644 --- a/MyToDo/Base.lproj/Main.storyboard +++ b/MyToDo/Base.lproj/Main.storyboard @@ -1,24 +1,80 @@ - + + + + - - + + - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MyToDo/Info.plist b/MyToDo/Info.plist index 16be3b6..42fac95 100644 --- a/MyToDo/Info.plist +++ b/MyToDo/Info.plist @@ -21,7 +21,7 @@ LSRequiresIPhoneOS UILaunchStoryboardName - LaunchScreen + Main UIMainStoryboardFile Main UIRequiredDeviceCapabilities diff --git a/MyToDo/ItemTableViewController.swift b/MyToDo/ItemTableViewController.swift new file mode 100644 index 0000000..310e6ab --- /dev/null +++ b/MyToDo/ItemTableViewController.swift @@ -0,0 +1,148 @@ +// +// ItemTableViewController.swift +// MyToDo +// +// Created by Angie Mugo on 17/01/2018. +// Copyright © 2018 Angie Mugo. All rights reserved. +// + +import UIKit + +class ItemTableViewController: UITableViewController { + + //1 + private let defaults = UserDefaults.standard + private var todoList = [ToDoItem]() + + //2 + override func viewDidLoad() { + super.viewDidLoad() + configureView() + fetchData() + } + + //3 + func configureView() { + //Only display the cells with content + tableView.tableFooterView = UIView(frame: .zero) + //Add color gradient to the view + let gradientLayer:CAGradientLayer = CAGradientLayer() + gradientLayer.frame = self.tableView.bounds + gradientLayer.colors = [UIColor.red.withAlphaComponent(5).cgColor,UIColor.yellow.withAlphaComponent(0.5).cgColor] + let backgroundView = UIView(frame: self.tableView.bounds) + backgroundView.layer.insertSublayer(gradientLayer, at: 0) + self.tableView.backgroundView = backgroundView + + } + + //MARK: IBActions + //4 + @IBAction func didTapAdd(_ sender: Any) { + + let alert = UIAlertController(title: "New To-Do Item", message: "Insert the title of the new to-do item:", preferredStyle: .alert) + alert.addTextField(configurationHandler: nil) + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (_) in + + if let title = alert.textFields![0].text { + guard !title.isEmpty else { return } + let newIndex = self.todoList.count + self.todoList.append(ToDoItem(title: title)) + + self.tableView.insertRows(at: [IndexPath(row: newIndex, section: 0)], with: .top) + + self.saveData() + } + + })) + + self.present(alert, animated: true, completion: nil) + + } + + // MARK: - Table view data source + //5 + override func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + //6 + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return todoList .count + } + + // MARK: - Table view delegate methods + //7 + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + + let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) + cell.backgroundColor = UIColor.clear + + if indexPath.row < todoList.count + { + let item = todoList[indexPath.row] + cell.textLabel?.text = item.title + + //MARK: set the checkmark for item done + let accessory: UITableViewCellAccessoryType = item.done ? .checkmark : .none + cell.accessoryType = accessory + } + + return cell + } + + //MARK: mark as done + //8 + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + + tableView.deselectRow(at: indexPath, animated: true) + if indexPath.row < todoList.count { + + todoList[indexPath.row].done = !todoList[indexPath.row].done + + tableView.reloadRows(at: [indexPath], with: .automatic) + + saveData() + } + } + + //MARK: delete items + //9 + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + + if indexPath.row < todoList.count { + + todoList.remove(at: indexPath.row) + + tableView.deleteRows(at: [indexPath], with: .top) + saveData() + } + } + + //MARK: fetch data from user defaults + //10 + func fetchData() { + + if let list = defaults.value(forKey: "encodedList") as? [[String: Any]] { + + for item in list { + guard let todoItem = ToDoItem(item) else { return } + todoList.append(todoItem) + } + } + } + + + //MARK: Save data to user defaults + //11 + func saveData() { + + var encodedList = [[String: Any]]() + + for item in todoList { + encodedList.append(item.toPropertyList()) + } + + defaults.set(encodedList, forKey: "encodedList") + } + +} diff --git a/MyToDo/ToDoItem.swift b/MyToDo/ToDoItem.swift new file mode 100644 index 0000000..1436f69 --- /dev/null +++ b/MyToDo/ToDoItem.swift @@ -0,0 +1,38 @@ +// +// ToDoItem.swift +// MyToDo +// +// Created by Angie Mugo on 17/01/2018. +// Copyright © 2018 Angie Mugo. All rights reserved. +// + +import Foundation + +struct ToDoItem { + + var title: String + var done: Bool + + public init(title: String) { + self.title = title + self.done = false + } + + public init?(_ pList: [String: Any]?) { + + guard let propertyList = pList, + let title = propertyList["title"] as? String, + let done = propertyList["done"] as? Bool + else { return nil } + + self.title = title + self.done = done + } + + func toPropertyList() -> [String: Any] { + + return ["title": self.title, + "done": self.done + ] + } +} diff --git a/MyToDo/ViewController.swift b/MyToDo/ViewController.swift deleted file mode 100644 index e99750c..0000000 --- a/MyToDo/ViewController.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// ViewController.swift -// MyToDo -// -// Created by Angie Mugo on 17/01/2018. -// Copyright © 2018 Angie Mugo. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - -} - diff --git a/MyToDoTests/Info.plist b/MyToDoTests/Info.plist deleted file mode 100644 index 6c40a6c..0000000 --- a/MyToDoTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/MyToDoTests/MyToDoTests.swift b/MyToDoTests/MyToDoTests.swift deleted file mode 100644 index 996dab1..0000000 --- a/MyToDoTests/MyToDoTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// MyToDoTests.swift -// MyToDoTests -// -// Created by Angie Mugo on 17/01/2018. -// Copyright © 2018 Angie Mugo. All rights reserved. -// - -import XCTest -@testable import MyToDo - -class MyToDoTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -}