Skip to content

Commit

Permalink
Todo's App
Browse files Browse the repository at this point in the history
  • Loading branch information
Buse ERKUŞ authored and Buse ERKUŞ committed Mar 15, 2019
1 parent e4ef63c commit 029f606
Show file tree
Hide file tree
Showing 34 changed files with 1,286 additions and 109 deletions.
124 changes: 108 additions & 16 deletions Todo.xcodeproj/project.pbxproj
Expand Up @@ -7,23 +7,53 @@
objects = {

/* Begin PBXBuildFile section */
9B1F178E223947FC000C8981 /* GDCheckBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1F178D223947FC000C8981 /* GDCheckBox.swift */; };
9B3C83CC223ADEFB00ECE7CF /* CoreDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B3C83CB223ADEFB00ECE7CF /* CoreDataManager.swift */; };
9B45753B2234FBCF00C27F03 /* GDButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B45753A2234FBCF00C27F03 /* GDButton.swift */; };
9B45753D22350D0300C27F03 /* ListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B45753C22350D0300C27F03 /* ListController.swift */; };
9B45753F223511B300C27F03 /* GDHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B45753E223511B300C27F03 /* GDHeaderView.swift */; };
9B4575432235425800C27F03 /* OptionSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4575422235425800C27F03 /* OptionSet.swift */; };
9B7AD36E2235B03900E765A7 /* Protocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7AD36D2235B03900E765A7 /* Protocol.swift */; };
9B7AD3702235B69C00E765A7 /* GDNewItemPopUp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7AD36F2235B69C00E765A7 /* GDNewItemPopUp.swift */; };
9B7AD3722235C16300E765A7 /* GDTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7AD3712235C16300E765A7 /* GDTextField.swift */; };
9BAF0E9F2231AC9E00413F78 /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAF0E9E2231AC9E00413F78 /* Extension.swift */; };
9BAF0EA22231C3D000413F78 /* GDLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAF0EA12231C3D000413F78 /* GDLabel.swift */; };
9BD8270A22380C54000646F6 /* GDTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8270922380C54000646F6 /* GDTableView.swift */; };
9BD8270C223843B9000646F6 /* GDListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8270B223843B9000646F6 /* GDListCell.swift */; };
9BD8270F223847F9000646F6 /* toDo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8270E223847F9000646F6 /* toDo.swift */; };
9BE689882231265A00138442 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE689872231265A00138442 /* AppDelegate.swift */; };
9BE6898A2231265A00138442 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE689892231265A00138442 /* ViewController.swift */; };
9BE6898D2231265A00138442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9BE6898B2231265A00138442 /* Main.storyboard */; };
9BE6898A2231265A00138442 /* WelcomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE689892231265A00138442 /* WelcomeController.swift */; };
9BE689902231265A00138442 /* Todo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 9BE6898E2231265A00138442 /* Todo.xcdatamodeld */; };
9BE689922231265B00138442 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9BE689912231265B00138442 /* Assets.xcassets */; };
9BE689952231265B00138442 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9BE689932231265B00138442 /* LaunchScreen.storyboard */; };
9BE6899D2231355D00138442 /* GDGradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE6899C2231355D00138442 /* GDGradient.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
9B1F178D223947FC000C8981 /* GDCheckBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDCheckBox.swift; sourceTree = "<group>"; };
9B3C83CB223ADEFB00ECE7CF /* CoreDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataManager.swift; sourceTree = "<group>"; };
9B45753A2234FBCF00C27F03 /* GDButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDButton.swift; sourceTree = "<group>"; };
9B45753C22350D0300C27F03 /* ListController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListController.swift; sourceTree = "<group>"; };
9B45753E223511B300C27F03 /* GDHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDHeaderView.swift; sourceTree = "<group>"; };
9B4575422235425800C27F03 /* OptionSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptionSet.swift; sourceTree = "<group>"; };
9B7AD36D2235B03900E765A7 /* Protocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Protocol.swift; sourceTree = "<group>"; };
9B7AD36F2235B69C00E765A7 /* GDNewItemPopUp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDNewItemPopUp.swift; sourceTree = "<group>"; };
9B7AD3712235C16300E765A7 /* GDTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDTextField.swift; sourceTree = "<group>"; };
9BAF0E9E2231AC9E00413F78 /* Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extension.swift; sourceTree = "<group>"; };
9BAF0EA12231C3D000413F78 /* GDLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDLabel.swift; sourceTree = "<group>"; };
9BAF0EAA2231CAE900413F78 /* Raleway-v4020-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Raleway-v4020-Regular.otf"; sourceTree = "<group>"; };
9BAF0EAB2231CAEA00413F78 /* Raleway-v4020-SemiBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Raleway-v4020-SemiBold.otf"; sourceTree = "<group>"; };
9BD8270922380C54000646F6 /* GDTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDTableView.swift; sourceTree = "<group>"; };
9BD8270B223843B9000646F6 /* GDListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDListCell.swift; sourceTree = "<group>"; };
9BD8270E223847F9000646F6 /* toDo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = toDo.swift; sourceTree = "<group>"; };
9BE689842231265A00138442 /* Todo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Todo.app; sourceTree = BUILT_PRODUCTS_DIR; };
9BE689872231265A00138442 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9BE689892231265A00138442 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
9BE6898C2231265A00138442 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
9BE689892231265A00138442 /* WelcomeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeController.swift; sourceTree = "<group>"; };
9BE6898F2231265A00138442 /* Todo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Todo.xcdatamodel; sourceTree = "<group>"; };
9BE689912231265B00138442 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9BE689942231265B00138442 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9BE689962231265B00138442 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9BE6899C2231355D00138442 /* GDGradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GDGradient.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -37,6 +67,58 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
9B4575412235162C00C27F03 /* Controllers */ = {
isa = PBXGroup;
children = (
9BE689892231265A00138442 /* WelcomeController.swift */,
9B45753C22350D0300C27F03 /* ListController.swift */,
);
path = Controllers;
sourceTree = "<group>";
};
9BAF0E9D2231AC8E00413F78 /* Extensions */ = {
isa = PBXGroup;
children = (
9BAF0E9E2231AC9E00413F78 /* Extension.swift */,
9B4575422235425800C27F03 /* OptionSet.swift */,
9B7AD36D2235B03900E765A7 /* Protocol.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
9BAF0EA02231C3AA00413F78 /* Custom */ = {
isa = PBXGroup;
children = (
9BE6899C2231355D00138442 /* GDGradient.swift */,
9BAF0EA12231C3D000413F78 /* GDLabel.swift */,
9B45753A2234FBCF00C27F03 /* GDButton.swift */,
9B45753E223511B300C27F03 /* GDHeaderView.swift */,
9B7AD36F2235B69C00E765A7 /* GDNewItemPopUp.swift */,
9B7AD3712235C16300E765A7 /* GDTextField.swift */,
9BD8270922380C54000646F6 /* GDTableView.swift */,
9BD8270B223843B9000646F6 /* GDListCell.swift */,
9B1F178D223947FC000C8981 /* GDCheckBox.swift */,
);
path = Custom;
sourceTree = "<group>";
};
9BAF0EA32231C56600413F78 /* fonts */ = {
isa = PBXGroup;
children = (
9BAF0EAA2231CAE900413F78 /* Raleway-v4020-Regular.otf */,
9BAF0EAB2231CAEA00413F78 /* Raleway-v4020-SemiBold.otf */,
);
path = fonts;
sourceTree = "<group>";
};
9BD8270D223847D7000646F6 /* Model */ = {
isa = PBXGroup;
children = (
9BD8270E223847F9000646F6 /* toDo.swift */,
);
path = Model;
sourceTree = "<group>";
};
9BE6897B2231265A00138442 = {
isa = PBXGroup;
children = (
Expand All @@ -57,8 +139,12 @@
isa = PBXGroup;
children = (
9BE689872231265A00138442 /* AppDelegate.swift */,
9BE689892231265A00138442 /* ViewController.swift */,
9BE6898B2231265A00138442 /* Main.storyboard */,
9B3C83CB223ADEFB00ECE7CF /* CoreDataManager.swift */,
9BD8270D223847D7000646F6 /* Model */,
9BAF0EA32231C56600413F78 /* fonts */,
9BAF0E9D2231AC8E00413F78 /* Extensions */,
9BAF0EA02231C3AA00413F78 /* Custom */,
9B4575412235162C00C27F03 /* Controllers */,
9BE689912231265B00138442 /* Assets.xcassets */,
9BE689932231265B00138442 /* LaunchScreen.storyboard */,
9BE689962231265B00138442 /* Info.plist */,
Expand Down Expand Up @@ -127,7 +213,6 @@
files = (
9BE689952231265B00138442 /* LaunchScreen.storyboard in Resources */,
9BE689922231265B00138442 /* Assets.xcassets in Resources */,
9BE6898D2231265A00138442 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -138,23 +223,30 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9BE6898A2231265A00138442 /* ViewController.swift in Sources */,
9BD8270C223843B9000646F6 /* GDListCell.swift in Sources */,
9BE6899D2231355D00138442 /* GDGradient.swift in Sources */,
9B45753B2234FBCF00C27F03 /* GDButton.swift in Sources */,
9B1F178E223947FC000C8981 /* GDCheckBox.swift in Sources */,
9B7AD3702235B69C00E765A7 /* GDNewItemPopUp.swift in Sources */,
9BE6898A2231265A00138442 /* WelcomeController.swift in Sources */,
9B3C83CC223ADEFB00ECE7CF /* CoreDataManager.swift in Sources */,
9B4575432235425800C27F03 /* OptionSet.swift in Sources */,
9BE689902231265A00138442 /* Todo.xcdatamodeld in Sources */,
9B7AD3722235C16300E765A7 /* GDTextField.swift in Sources */,
9BAF0EA22231C3D000413F78 /* GDLabel.swift in Sources */,
9BD8270A22380C54000646F6 /* GDTableView.swift in Sources */,
9B7AD36E2235B03900E765A7 /* Protocol.swift in Sources */,
9BD8270F223847F9000646F6 /* toDo.swift in Sources */,
9BAF0E9F2231AC9E00413F78 /* Extension.swift in Sources */,
9B45753F223511B300C27F03 /* GDHeaderView.swift in Sources */,
9BE689882231265A00138442 /* AppDelegate.swift in Sources */,
9B45753D22350D0300C27F03 /* ListController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
9BE6898B2231265A00138442 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
9BE6898C2231265A00138442 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
9BE689932231265B00138442 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down
98 changes: 98 additions & 0 deletions Todo.xcodeproj/xcshareddata/xcschemes/Todo.xcscheme
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9BE689832231265A00138442"
BuildableName = "Todo.app"
BlueprintName = "Todo"
ReferencedContainer = "container:Todo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9BE689832231265A00138442"
BuildableName = "Todo.app"
BlueprintName = "Todo"
ReferencedContainer = "container:Todo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9BE689832231265A00138442"
BuildableName = "Todo.app"
BlueprintName = "Todo"
ReferencedContainer = "container:Todo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9BE689832231265A00138442"
BuildableName = "Todo.app"
BlueprintName = "Todo"
ReferencedContainer = "container:Todo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Expand Up @@ -10,5 +10,13 @@
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9BE689832231265A00138442</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
55 changes: 10 additions & 45 deletions Todo/AppDelegate.swift
Expand Up @@ -17,6 +17,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

let hasVisistedWelcomeController = UserDefaults.standard.bool(forKey: "welcome-controller-visited")
let initialController = hasVisistedWelcomeController ? ListController() : WelcomeController()

window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
window?.rootViewController = initialController
return true
}

Expand All @@ -41,53 +48,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
// self.saveContext()
}

// MARK: - Core Data stack

lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "Todo")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.

/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()

// MARK: - Core Data Saving support

func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}



}

23 changes: 23 additions & 0 deletions Todo/Assets.xcassets/add-icon.imageset/Contents.json
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "add-icon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "add-icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "add-icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added Todo/Assets.xcassets/add-icon.imageset/add-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 029f606

Please sign in to comment.