diff --git a/AppDelegate.swift b/AppDelegate.swift
deleted file mode 100755
index 5c1a739..0000000
--- a/AppDelegate.swift
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// AppDelegate.swift
-// swiftPeaceTrack<3
-//
-// Created by Shelagh McGowan on 7/4/14.
-// Copyright (c) 2014 Shelagh McGowan. All rights reserved.
-//
-//what did the baby computer call it's father? data
-
-import UIKit
-import CoreData
-
-@UIApplicationMain
-class AppDelegate: UIResponder, UIApplicationDelegate {
-
- var window: UIWindow?
-
-
- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
-
- 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 throttle down OpenGL ES frame rates. 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.
- }
-
- func applicationWillEnterForeground(application: UIApplication) {
- // Called as part of the transition from the background to the inactive 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:.
- // Saves changes in the application's managed object context before the application terminates.
- self.saveContext()
- }
-
- func saveContext () {
- var error: NSError? = nil
- let managedObjectContext = self.managedObjectContext
- if managedObjectContext != nil {
- if managedObjectContext.hasChanges && !managedObjectContext.save(&error) {
- // Replace this implementation with code to handle the error appropriately.
- // abort() 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.
- //println("Unresolved error \(error), \(error.userInfo)")
- abort()
- }
- }
- }
-
- // #pragma mark - Core Data stack
-
- // Returns the managed object context for the application.
- // If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
- var managedObjectContext: NSManagedObjectContext {
- if !_managedObjectContext {
- let coordinator = self.persistentStoreCoordinator
- if coordinator != nil {
- _managedObjectContext = NSManagedObjectContext()
- _managedObjectContext!.persistentStoreCoordinator = coordinator
- }
- }
- return _managedObjectContext!
- }
- var _managedObjectContext: NSManagedObjectContext? = nil
-
- // Returns the managed object model for the application.
- // If the model doesn't already exist, it is created from the application's model.
- var managedObjectModel: NSManagedObjectModel {
- if !_managedObjectModel {
- let modelURL = NSBundle.mainBundle().URLForResource("swiftPeaceTrack_3", withExtension: "momd")
- _managedObjectModel = NSManagedObjectModel(contentsOfURL: modelURL)
- }
- return _managedObjectModel!
- }
- var _managedObjectModel: NSManagedObjectModel? = nil
-
- // Returns the persistent store coordinator for the application.
- // If the coordinator doesn't already exist, it is created and the application's store added to it.
- var persistentStoreCoordinator: NSPersistentStoreCoordinator {
- if !_persistentStoreCoordinator {
- let storeURL = self.applicationDocumentsDirectory.URLByAppendingPathComponent("swiftPeaceTrack_3.sqlite")
- var error: NSError? = nil
- _persistentStoreCoordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
- if _persistentStoreCoordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: storeURL, options: nil, error: &error) == nil {
- /*
- Replace this implementation with code to handle the error appropriately.
-
- abort() 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 persistent store is not accessible;
- * The schema for the persistent store is incompatible with current managed object model.
- Check the error message to determine what the actual problem was.
-
-
- If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory.
-
- If you encounter schema incompatibility errors during development, you can reduce their frequency by:
- * Simply deleting the existing store:
- NSFileManager.defaultManager().removeItemAtURL(storeURL, error: nil)
-
- * Performing automatic lightweight migration by passing the following dictionary as the options parameter:
- [NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true}
-
- Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details.
-
- */
- //println("Unresolved error \(error), \(error.userInfo)")
- abort()
- }
- }
- return _persistentStoreCoordinator!
- }
- var _persistentStoreCoordinator: NSPersistentStoreCoordinator? = nil
-
- // #pragma mark - Application's Documents directory
-
- // Returns the URL to the application's Documents directory.
- var applicationDocumentsDirectory: NSURL {
- let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
- return urls[urls.endIndex-1] as NSURL
- }
-
-}
-
diff --git a/Images.xcassets/AppIcon.appiconset/Contents.json b/Images.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100755
index a396706..0000000
--- a/Images.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "iphone",
- "size" : "29x29",
- "scale" : "2x"
- },
- {
- "idiom" : "iphone",
- "size" : "40x40",
- "scale" : "2x"
- },
- {
- "idiom" : "iphone",
- "size" : "60x60",
- "scale" : "2x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/Images.xcassets/LaunchImage.launchimage/Contents.json b/Images.xcassets/LaunchImage.launchimage/Contents.json
deleted file mode 100755
index c79ebd3..0000000
--- a/Images.xcassets/LaunchImage.launchimage/Contents.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "images" : [
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "extent" : "full-screen",
- "minimum-system-version" : "7.0",
- "scale" : "2x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "subtype" : "retina4",
- "extent" : "full-screen",
- "minimum-system-version" : "7.0",
- "scale" : "2x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/Main.storyboard b/Main.storyboard
deleted file mode 100755
index e111ef3..0000000
--- a/Main.storyboard
+++ /dev/null
@@ -1,314 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Model.xcdatamodeld/Model.xcdatamodel/contents b/Model.xcdatamodeld/Model.xcdatamodel/contents
new file mode 100644
index 0000000..ce0ed27
--- /dev/null
+++ b/Model.xcdatamodeld/Model.xcdatamodel/contents
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PeaceTrack.xcodeproj/project.pbxproj b/PeaceTrack.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..da59d59
--- /dev/null
+++ b/PeaceTrack.xcodeproj/project.pbxproj
@@ -0,0 +1,485 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 183B8D921B8267010084ED86 /* ActivityTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183B8D911B8267010084ED86 /* ActivityTableViewController.swift */; };
+ 183B8D941B826B530084ED86 /* ActivityDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183B8D931B826B530084ED86 /* ActivityDetailViewController.swift */; };
+ 183BA1BA1B83427A0039DDE3 /* MeasurementTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183BA1B91B8342790039DDE3 /* MeasurementTableViewController.swift */; };
+ 183BA1BC1B8342C40039DDE3 /* AddMeasurementViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183BA1BB1B8342C40039DDE3 /* AddMeasurementViewController.swift */; };
+ 183BA1BE1B8343050039DDE3 /* MeasurementDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183BA1BD1B8343050039DDE3 /* MeasurementDetailViewController.swift */; };
+ 188FE1E11B3D48670018DB93 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 188FE1E01B3D48670018DB93 /* AppDelegate.swift */; };
+ 188FE1E31B3D48670018DB93 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 188FE1E21B3D48670018DB93 /* ViewController.swift */; };
+ 188FE1E61B3D48670018DB93 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 188FE1E41B3D48670018DB93 /* Main.storyboard */; };
+ 188FE1E81B3D48680018DB93 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 188FE1E71B3D48680018DB93 /* Images.xcassets */; };
+ 188FE1EB1B3D48680018DB93 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 188FE1E91B3D48680018DB93 /* LaunchScreen.xib */; };
+ 188FE1F71B3D48680018DB93 /* PeaceTrackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 188FE1F61B3D48680018DB93 /* PeaceTrackTests.swift */; };
+ 188FE2011B3D62E70018DB93 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 188FE2001B3D62E70018DB93 /* LoginViewController.swift */; };
+ 18A1B2431B400E6100512610 /* NavViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A1B2421B400E6100512610 /* NavViewController.swift */; };
+ 18CC945A1B7F8D8A000F3D27 /* AddActivityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18CC94591B7F8D89000F3D27 /* AddActivityViewController.swift */; };
+ 18FD4B491B53BC52005D40B8 /* CohortsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FD4B481B53BC52005D40B8 /* CohortsTableViewController.swift */; };
+ 18FD4B4B1B53C7CD005D40B8 /* AddCohortViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FD4B4A1B53C7CC005D40B8 /* AddCohortViewController.swift */; };
+ 18FD4B4E1B53CB77005D40B8 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 18FD4B4C1B53CB76005D40B8 /* Model.xcdatamodeld */; };
+ 18FD4B521B53E156005D40B8 /* CohortDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FD4B511B53E156005D40B8 /* CohortDetailViewController.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 188FE1F11B3D48680018DB93 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 188FE1D31B3D48670018DB93 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 188FE1DA1B3D48670018DB93;
+ remoteInfo = PeaceTrack;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 183B8D911B8267010084ED86 /* ActivityTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityTableViewController.swift; sourceTree = ""; };
+ 183B8D931B826B530084ED86 /* ActivityDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityDetailViewController.swift; sourceTree = ""; };
+ 183BA1B91B8342790039DDE3 /* MeasurementTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MeasurementTableViewController.swift; sourceTree = ""; };
+ 183BA1BB1B8342C40039DDE3 /* AddMeasurementViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddMeasurementViewController.swift; sourceTree = ""; };
+ 183BA1BD1B8343050039DDE3 /* MeasurementDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MeasurementDetailViewController.swift; sourceTree = ""; };
+ 188FE1DB1B3D48670018DB93 /* PeaceTrack.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PeaceTrack.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 188FE1DF1B3D48670018DB93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 188FE1E01B3D48670018DB93 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 188FE1E21B3D48670018DB93 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
+ 188FE1E51B3D48670018DB93 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 188FE1E71B3D48680018DB93 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
+ 188FE1EA1B3D48680018DB93 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
+ 188FE1F01B3D48680018DB93 /* PeaceTrackTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PeaceTrackTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 188FE1F51B3D48680018DB93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 188FE1F61B3D48680018DB93 /* PeaceTrackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PeaceTrackTests.swift; sourceTree = ""; };
+ 188FE2001B3D62E70018DB93 /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; };
+ 18A1B2421B400E6100512610 /* NavViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavViewController.swift; sourceTree = ""; };
+ 18CC94591B7F8D89000F3D27 /* AddActivityViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddActivityViewController.swift; sourceTree = ""; };
+ 18FD4B481B53BC52005D40B8 /* CohortsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CohortsTableViewController.swift; sourceTree = ""; };
+ 18FD4B4A1B53C7CC005D40B8 /* AddCohortViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddCohortViewController.swift; sourceTree = ""; };
+ 18FD4B4D1B53CB77005D40B8 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; };
+ 18FD4B511B53E156005D40B8 /* CohortDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CohortDetailViewController.swift; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 188FE1D81B3D48670018DB93 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 188FE1ED1B3D48680018DB93 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 188FE1D21B3D48670018DB93 = {
+ isa = PBXGroup;
+ children = (
+ 18FD4B4C1B53CB76005D40B8 /* Model.xcdatamodeld */,
+ 188FE1DD1B3D48670018DB93 /* PeaceTrack */,
+ 188FE1F31B3D48680018DB93 /* PeaceTrackTests */,
+ 188FE1DC1B3D48670018DB93 /* Products */,
+ );
+ sourceTree = "";
+ };
+ 188FE1DC1B3D48670018DB93 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 188FE1DB1B3D48670018DB93 /* PeaceTrack.app */,
+ 188FE1F01B3D48680018DB93 /* PeaceTrackTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 188FE1DD1B3D48670018DB93 /* PeaceTrack */ = {
+ isa = PBXGroup;
+ children = (
+ 188FE1E01B3D48670018DB93 /* AppDelegate.swift */,
+ 188FE1E21B3D48670018DB93 /* ViewController.swift */,
+ 188FE1E41B3D48670018DB93 /* Main.storyboard */,
+ 188FE1E71B3D48680018DB93 /* Images.xcassets */,
+ 188FE1E91B3D48680018DB93 /* LaunchScreen.xib */,
+ 188FE1DE1B3D48670018DB93 /* Supporting Files */,
+ 188FE2001B3D62E70018DB93 /* LoginViewController.swift */,
+ 18A1B2421B400E6100512610 /* NavViewController.swift */,
+ 18FD4B481B53BC52005D40B8 /* CohortsTableViewController.swift */,
+ 18FD4B4A1B53C7CC005D40B8 /* AddCohortViewController.swift */,
+ 18FD4B511B53E156005D40B8 /* CohortDetailViewController.swift */,
+ 18CC94591B7F8D89000F3D27 /* AddActivityViewController.swift */,
+ 183B8D911B8267010084ED86 /* ActivityTableViewController.swift */,
+ 183B8D931B826B530084ED86 /* ActivityDetailViewController.swift */,
+ 183BA1B91B8342790039DDE3 /* MeasurementTableViewController.swift */,
+ 183BA1BB1B8342C40039DDE3 /* AddMeasurementViewController.swift */,
+ 183BA1BD1B8343050039DDE3 /* MeasurementDetailViewController.swift */,
+ );
+ path = PeaceTrack;
+ sourceTree = "";
+ };
+ 188FE1DE1B3D48670018DB93 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 188FE1DF1B3D48670018DB93 /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
+ 188FE1F31B3D48680018DB93 /* PeaceTrackTests */ = {
+ isa = PBXGroup;
+ children = (
+ 188FE1F61B3D48680018DB93 /* PeaceTrackTests.swift */,
+ 188FE1F41B3D48680018DB93 /* Supporting Files */,
+ );
+ path = PeaceTrackTests;
+ sourceTree = "";
+ };
+ 188FE1F41B3D48680018DB93 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 188FE1F51B3D48680018DB93 /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 188FE1DA1B3D48670018DB93 /* PeaceTrack */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 188FE1FA1B3D48680018DB93 /* Build configuration list for PBXNativeTarget "PeaceTrack" */;
+ buildPhases = (
+ 188FE1D71B3D48670018DB93 /* Sources */,
+ 188FE1D81B3D48670018DB93 /* Frameworks */,
+ 188FE1D91B3D48670018DB93 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = PeaceTrack;
+ productName = PeaceTrack;
+ productReference = 188FE1DB1B3D48670018DB93 /* PeaceTrack.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 188FE1EF1B3D48680018DB93 /* PeaceTrackTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 188FE1FD1B3D48680018DB93 /* Build configuration list for PBXNativeTarget "PeaceTrackTests" */;
+ buildPhases = (
+ 188FE1EC1B3D48680018DB93 /* Sources */,
+ 188FE1ED1B3D48680018DB93 /* Frameworks */,
+ 188FE1EE1B3D48680018DB93 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 188FE1F21B3D48680018DB93 /* PBXTargetDependency */,
+ );
+ name = PeaceTrackTests;
+ productName = PeaceTrackTests;
+ productReference = 188FE1F01B3D48680018DB93 /* PeaceTrackTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 188FE1D31B3D48670018DB93 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0620;
+ ORGANIZATIONNAME = Systers;
+ TargetAttributes = {
+ 188FE1DA1B3D48670018DB93 = {
+ CreatedOnToolsVersion = 6.2;
+ };
+ 188FE1EF1B3D48680018DB93 = {
+ CreatedOnToolsVersion = 6.2;
+ TestTargetID = 188FE1DA1B3D48670018DB93;
+ };
+ };
+ };
+ buildConfigurationList = 188FE1D61B3D48670018DB93 /* Build configuration list for PBXProject "PeaceTrack" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 188FE1D21B3D48670018DB93;
+ productRefGroup = 188FE1DC1B3D48670018DB93 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 188FE1DA1B3D48670018DB93 /* PeaceTrack */,
+ 188FE1EF1B3D48680018DB93 /* PeaceTrackTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 188FE1D91B3D48670018DB93 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 188FE1E61B3D48670018DB93 /* Main.storyboard in Resources */,
+ 188FE1EB1B3D48680018DB93 /* LaunchScreen.xib in Resources */,
+ 188FE1E81B3D48680018DB93 /* Images.xcassets in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 188FE1EE1B3D48680018DB93 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 188FE1D71B3D48670018DB93 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 183B8D941B826B530084ED86 /* ActivityDetailViewController.swift in Sources */,
+ 183BA1BC1B8342C40039DDE3 /* AddMeasurementViewController.swift in Sources */,
+ 18FD4B521B53E156005D40B8 /* CohortDetailViewController.swift in Sources */,
+ 188FE2011B3D62E70018DB93 /* LoginViewController.swift in Sources */,
+ 18FD4B491B53BC52005D40B8 /* CohortsTableViewController.swift in Sources */,
+ 183BA1BA1B83427A0039DDE3 /* MeasurementTableViewController.swift in Sources */,
+ 18CC945A1B7F8D8A000F3D27 /* AddActivityViewController.swift in Sources */,
+ 18A1B2431B400E6100512610 /* NavViewController.swift in Sources */,
+ 18FD4B4E1B53CB77005D40B8 /* Model.xcdatamodeld in Sources */,
+ 183B8D921B8267010084ED86 /* ActivityTableViewController.swift in Sources */,
+ 188FE1E31B3D48670018DB93 /* ViewController.swift in Sources */,
+ 188FE1E11B3D48670018DB93 /* AppDelegate.swift in Sources */,
+ 183BA1BE1B8343050039DDE3 /* MeasurementDetailViewController.swift in Sources */,
+ 18FD4B4B1B53C7CD005D40B8 /* AddCohortViewController.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 188FE1EC1B3D48680018DB93 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 188FE1F71B3D48680018DB93 /* PeaceTrackTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 188FE1F21B3D48680018DB93 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 188FE1DA1B3D48670018DB93 /* PeaceTrack */;
+ targetProxy = 188FE1F11B3D48680018DB93 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 188FE1E41B3D48670018DB93 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 188FE1E51B3D48670018DB93 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 188FE1E91B3D48680018DB93 /* LaunchScreen.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 188FE1EA1B3D48680018DB93 /* Base */,
+ );
+ name = LaunchScreen.xib;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 188FE1F81B3D48680018DB93 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.2;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 188FE1F91B3D48680018DB93 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.2;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 188FE1FB1B3D48680018DB93 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ INFOPLIST_FILE = PeaceTrack/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ 188FE1FC1B3D48680018DB93 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ INFOPLIST_FILE = PeaceTrack/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ 188FE1FE1B3D48680018DB93 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = PeaceTrackTests/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PeaceTrack.app/PeaceTrack";
+ };
+ name = Debug;
+ };
+ 188FE1FF1B3D48680018DB93 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = PeaceTrackTests/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PeaceTrack.app/PeaceTrack";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 188FE1D61B3D48670018DB93 /* Build configuration list for PBXProject "PeaceTrack" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 188FE1F81B3D48680018DB93 /* Debug */,
+ 188FE1F91B3D48680018DB93 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 188FE1FA1B3D48680018DB93 /* Build configuration list for PBXNativeTarget "PeaceTrack" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 188FE1FB1B3D48680018DB93 /* Debug */,
+ 188FE1FC1B3D48680018DB93 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 188FE1FD1B3D48680018DB93 /* Build configuration list for PBXNativeTarget "PeaceTrackTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 188FE1FE1B3D48680018DB93 /* Debug */,
+ 188FE1FF1B3D48680018DB93 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+
+/* Begin XCVersionGroup section */
+ 18FD4B4C1B53CB76005D40B8 /* Model.xcdatamodeld */ = {
+ isa = XCVersionGroup;
+ children = (
+ 18FD4B4D1B53CB77005D40B8 /* Model.xcdatamodel */,
+ );
+ currentVersion = 18FD4B4D1B53CB77005D40B8 /* Model.xcdatamodel */;
+ path = Model.xcdatamodeld;
+ sourceTree = "";
+ versionGroupType = wrapper.xcdatamodel;
+ };
+/* End XCVersionGroup section */
+ };
+ rootObject = 188FE1D31B3D48670018DB93 /* Project object */;
+}
diff --git a/swiftPeaceTrack<3.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/PeaceTrack.xcodeproj/project.xcworkspace/contents.xcworkspacedata
similarity index 66%
rename from swiftPeaceTrack<3.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to PeaceTrack.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 417c906..542b4b0 100644
--- a/swiftPeaceTrack<3.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/PeaceTrack.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:PeaceTrack.xcodeproj">
diff --git a/PeaceTrack.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate b/PeaceTrack.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..25bef2f
Binary files /dev/null and b/PeaceTrack.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
new file mode 100644
index 0000000..fe2b454
--- /dev/null
+++ b/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -0,0 +1,5 @@
+
+
+
diff --git a/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcschemes/swiftPeaceTrack<3.xcscheme b/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/PeaceTrack.xcscheme
similarity index 56%
rename from swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcschemes/swiftPeaceTrack<3.xcscheme
rename to PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/PeaceTrack.xcscheme
index 5f855e4..0266fdd 100644
--- a/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcschemes/swiftPeaceTrack<3.xcscheme
+++ b/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/PeaceTrack.xcscheme
@@ -1,6 +1,6 @@
+ BlueprintIdentifier = "188FE1DA1B3D48670018DB93"
+ BuildableName = "PeaceTrack.app"
+ BlueprintName = "PeaceTrack"
+ ReferencedContainer = "container:PeaceTrack.xcodeproj">
+
+
+
+
@@ -32,20 +46,20 @@
skipped = "NO">
+ BlueprintIdentifier = "188FE1EF1B3D48680018DB93"
+ BuildableName = "PeaceTrackTests.xctest"
+ BlueprintName = "PeaceTrackTests"
+ ReferencedContainer = "container:PeaceTrack.xcodeproj">
+ BlueprintIdentifier = "188FE1DA1B3D48670018DB93"
+ BuildableName = "PeaceTrack.app"
+ BlueprintName = "PeaceTrack"
+ ReferencedContainer = "container:PeaceTrack.xcodeproj">
@@ -58,13 +72,14 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
-
+
+ BlueprintIdentifier = "188FE1DA1B3D48670018DB93"
+ BuildableName = "PeaceTrack.app"
+ BlueprintName = "PeaceTrack"
+ ReferencedContainer = "container:PeaceTrack.xcodeproj">
@@ -76,13 +91,14 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
-
+
+ BlueprintIdentifier = "188FE1DA1B3D48670018DB93"
+ BuildableName = "PeaceTrack.app"
+ BlueprintName = "PeaceTrack"
+ ReferencedContainer = "container:PeaceTrack.xcodeproj">
diff --git a/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcschemes/xcschememanagement.plist b/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist
similarity index 79%
rename from swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcschemes/xcschememanagement.plist
rename to PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist
index 97ee08e..6a1526a 100644
--- a/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/PeaceTrack.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -4,7 +4,7 @@
SchemeUserState
- swiftPeaceTrack<3.xcscheme
+ PeaceTrack.xcscheme
orderHint
0
@@ -12,12 +12,12 @@
SuppressBuildableAutocreation
- 215711DB19673D0D009A533C
+ 188FE1DA1B3D48670018DB93
primary
- 215711EB19673D0E009A533C
+ 188FE1EF1B3D48680018DB93
primary
diff --git a/PeaceTrack/.DS_Store b/PeaceTrack/.DS_Store
new file mode 100644
index 0000000..1ccdd68
Binary files /dev/null and b/PeaceTrack/.DS_Store differ
diff --git a/PeaceTrack/ActivityDetailViewController.swift b/PeaceTrack/ActivityDetailViewController.swift
new file mode 100644
index 0000000..00e00fd
--- /dev/null
+++ b/PeaceTrack/ActivityDetailViewController.swift
@@ -0,0 +1,53 @@
+//
+// ActivityDetailViewController.swift
+// PeaceTrack
+//
+// Created by apple on 8/18/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+
+class ActivityDetailViewController: UIViewController {
+
+ @IBOutlet weak var activityName: UILabel!
+ @IBOutlet weak var activityCohort: UILabel!
+ @IBOutlet weak var activityOutput: UILabel!
+ @IBOutlet weak var activityDate: UILabel!
+ @IBOutlet weak var activityDesc: UILabel!
+
+ var name: String = ""
+ var cohort: String = ""
+ var output: String = ""
+ var date: String = ""
+ var desc: String = ""
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ activityName.text = name
+ activityCohort.text = cohort
+ activityOutput.text = output
+ activityDate.text = date
+ activityDesc.text = desc
+
+ // Do any additional setup after loading the view.
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
diff --git a/PeaceTrack/ActivityTableViewController.swift b/PeaceTrack/ActivityTableViewController.swift
new file mode 100644
index 0000000..11b0f4d
--- /dev/null
+++ b/PeaceTrack/ActivityTableViewController.swift
@@ -0,0 +1,191 @@
+//
+// ActivityTableViewController.swift
+// PeaceTrack
+//
+// Created by apple on 8/18/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class ActivityTableViewController: UITableViewController, UISearchResultsUpdating {
+
+ var tableData = [String]()
+
+ var filteredTableData = [String]()
+
+ var resultSearchController = UISearchController()
+
+ var activities = [NSManagedObject]()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ self.resultSearchController = ({
+ let controller = UISearchController(searchResultsController: nil)
+ controller.searchResultsUpdater = self
+ controller.dimsBackgroundDuringPresentation = false
+ controller.searchBar.sizeToFit()
+
+ self.tableView.tableHeaderView = controller.searchBar
+
+ return controller
+ })()
+
+ self.tableView.reloadData()
+
+ // Uncomment the following line to preserve selection between presentations
+ // self.clearsSelectionOnViewWillAppear = false
+
+ // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+ // self.navigationItem.rightBarButtonItem = self.editButtonItem()
+ }
+
+ override func viewDidAppear(animated: Bool) {
+ super.viewDidAppear(true)
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let fetchRequest = NSFetchRequest(entityName: "Activity")
+
+ var error: NSError?
+
+ let fetchedResults = managedContext.executeFetchRequest(fetchRequest, error: &error) as? [NSManagedObject]
+
+ let results = fetchedResults
+
+ tableData.removeAll(keepCapacity: false);
+ if (results != nil) {
+ activities = results!
+ for (var i=0;i Int {
+ // #warning Potentially incomplete method implementation.
+ // Return the number of sections.
+ return 1
+ }
+
+ override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+ // #warning Incomplete method implementation.
+ // Return the number of rows in the section.
+ if (self.resultSearchController.active) {
+ return self.filteredTableData.count
+ } else {
+ return activities.count
+ }
+ }
+
+
+ override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
+ let cell = tableView.dequeueReusableCellWithIdentifier("ActivityCell", forIndexPath: indexPath) as! UITableViewCell
+
+ if (self.resultSearchController.active) {
+ cell.textLabel?.text = filteredTableData[indexPath.row]
+
+ return cell
+ } else {
+ let cohort = activities[indexPath.row]
+ cell.textLabel?.text = cohort.valueForKey("name") as? String
+
+ return cell
+
+ }
+ }
+
+ func updateSearchResultsForSearchController(searchController: UISearchController) {
+ filteredTableData.removeAll(keepCapacity: false)
+
+ let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text)
+
+ let array = (tableData as NSArray).filteredArrayUsingPredicate(searchPredicate)
+ filteredTableData = array as! [String]
+
+ self.tableView.reloadData()
+ }
+
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ if segue.identifier == "showActivity" {
+ let indexPath:NSIndexPath = self.tableView.indexPathForSelectedRow()!
+ let activityDetailVC:ActivityDetailViewController = segue.destinationViewController as! ActivityDetailViewController
+
+ let activity = activities[indexPath.row]
+ activityDetailVC.name = (activity.valueForKey("name") as? String)!
+ activityDetailVC.desc = (activity.valueForKey("activityDescription") as? String)!
+ activityDetailVC.cohort = (activity.valueForKey("activityCohort") as? String)!
+ activityDetailVC.output = (activity.valueForKey("activityOutput") as? String)!
+ activityDetailVC.date = (activity.valueForKey("activityDate") as? String)!
+
+ }
+ }
+
+
+
+ /*
+ // Override to support conditional editing of the table view.
+ override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
+ // Return NO if you do not want the specified item to be editable.
+ return true
+ }
+ */
+
+ /*
+ // Override to support editing the table view.
+ override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
+ if editingStyle == .Delete {
+ // Delete the row from the data source
+ tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
+ } else if editingStyle == .Insert {
+ // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
+ }
+ }
+ */
+
+ /*
+ // Override to support rearranging the table view.
+ override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
+
+ }
+ */
+
+ /*
+ // Override to support conditional rearranging of the table view.
+ override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
+ // Return NO if you do not want the item to be re-orderable.
+ return true
+ }
+ */
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
diff --git a/PeaceTrack/AddActivityViewController.swift b/PeaceTrack/AddActivityViewController.swift
new file mode 100644
index 0000000..e4448af
--- /dev/null
+++ b/PeaceTrack/AddActivityViewController.swift
@@ -0,0 +1,159 @@
+//
+// AddActivityViewController.swift
+// PeaceTrack
+//
+// Created by apple on 8/15/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class AddActivityViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
+
+ @IBOutlet weak var activityName: UITextField!
+ @IBOutlet weak var activityDesc: UITextField!
+// @IBOutlet weak var datePicker: UIDatePicker!
+ @IBOutlet weak var addDate: UITextField!
+
+ @IBOutlet weak var cohortSelectTextField: UITextField!
+
+ @IBOutlet weak var outputSelectTextField: UITextField!
+
+ var cohortOptions = [String]()
+ var outputOptions = ["Output1", "Output2", "Output3", "Output4"]
+ var cohorts = [NSManagedObject]()
+ var pickerViewType = ""
+
+ @IBAction func dateFieldEditing(sender: UITextField) {
+
+ if(sender.restorationIdentifier=="addDateField") {
+
+ var datePickerView:UIDatePicker = UIDatePicker()
+ datePickerView.datePickerMode = UIDatePickerMode.DateAndTime
+ sender.inputView = datePickerView
+ datePickerView.addTarget(self, action: Selector("datePickerValueChanged:"), forControlEvents: UIControlEvents.ValueChanged)
+ }
+ }
+
+ @IBAction func outputOptionsEditing(sender: UITextField) {
+ if(sender.restorationIdentifier=="outputSelectField") {
+ pickerViewType = "output"
+ var outputPickerView = UIPickerView()
+ outputPickerView.delegate = self
+ outputSelectTextField.inputView = outputPickerView
+ }
+ }
+ func datePickerValueChanged(sender:UIDatePicker) {
+ var dateFormatter = NSDateFormatter()
+ dateFormatter.dateStyle = NSDateFormatterStyle.MediumStyle
+ dateFormatter.timeStyle = NSDateFormatterStyle.MediumStyle
+ addDate.text = dateFormatter.stringFromDate(sender.date)
+ }
+
+ @IBAction func cohortOptionsEditing(sender: UITextField) {
+
+ if(sender.restorationIdentifier=="cohortSelectField") {
+ pickerViewType = "cohort"
+ var cohortPickerView = UIPickerView()
+ cohortPickerView.delegate = self
+ cohortSelectTextField.inputView = cohortPickerView
+ }
+
+ }
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let fetchRequest = NSFetchRequest(entityName: "Cohort")
+
+ var error: NSError?
+
+ let fetchedResults = managedContext.executeFetchRequest(fetchRequest, error: &error) as? [NSManagedObject]
+
+ let results = fetchedResults
+
+ cohortOptions.removeAll(keepCapacity: false);
+ if (results != nil) {
+ cohorts = results!
+ for (var i=0;i Int {
+ return 1
+ }
+
+ func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
+ if(pickerViewType=="cohort") {
+ return cohortOptions.count
+ } else {
+ return outputOptions.count
+ }
+ }
+
+ func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
+ if(pickerViewType=="cohort") {
+ return cohortOptions[row]
+ } else {
+ return outputOptions[row]
+ }
+ }
+
+ func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
+ if(pickerViewType=="cohort") {
+ cohortSelectTextField.text = cohortOptions[row]
+ } else {
+ outputSelectTextField.text = outputOptions[row]
+ }
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+ @IBAction func saveActivityTapped(sender: AnyObject) {
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let entity = NSEntityDescription.entityForName("Activity", inManagedObjectContext: managedContext)
+
+ let activity = NSManagedObject(entity: entity!, insertIntoManagedObjectContext: managedContext)
+
+ activity.setValue(activityName.text, forKey: "name")
+ activity.setValue(activityDesc.text, forKey: "activityDescription")
+ activity.setValue(cohortSelectTextField.text, forKey: "activityCohort")
+ activity.setValue(outputSelectTextField.text, forKey: "activityOutput")
+ activity.setValue(addDate.text, forKey: "activityDate")
+
+ var error: NSError?
+ if !managedContext.save(&error) {
+ println("Could not save \(error), \(error?.userInfo)")
+ }
+
+ navigationController?.popViewControllerAnimated(true)
+
+ }
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
\ No newline at end of file
diff --git a/PeaceTrack/AddCohortViewController.swift b/PeaceTrack/AddCohortViewController.swift
new file mode 100644
index 0000000..bd281ad
--- /dev/null
+++ b/PeaceTrack/AddCohortViewController.swift
@@ -0,0 +1,216 @@
+//
+// AddCohortViewController.swift
+// PeaceTrack
+//
+// Created by apple on 7/13/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class AddCohortViewController: UIViewController {
+
+ @IBOutlet weak var nameTextField: UITextField!
+
+ @IBOutlet weak var descriptionTextField: UITextField!
+
+ @IBOutlet weak var members: UITextField!
+ @IBOutlet weak var ageFrom: UITextField!
+ @IBOutlet weak var ageTo: UITextField!
+ @IBOutlet weak var maleMembers: UITextField!
+ @IBOutlet weak var femaleMembers: UITextField!
+ @IBOutlet weak var commPosition: UITextField!
+ @IBOutlet weak var notes: UITextField!
+
+ @IBAction func saveButtonTapped(sender: AnyObject) {
+
+ self.saveCohort()
+ self.saveToServer()
+ navigationController?.popViewControllerAnimated(true)
+
+ }
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ // Do any additional setup after loading the view, typically from a nib.
+ }
+
+ override func viewDidAppear(animated: Bool) {
+
+ }
+
+ func saveCohort() {
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let entity = NSEntityDescription.entityForName("Cohort", inManagedObjectContext: managedContext)
+
+ let cohort = NSManagedObject(entity: entity!, insertIntoManagedObjectContext: managedContext)
+
+ cohort.setValue(nameTextField.text, forKey: "name")
+ cohort.setValue(descriptionTextField.text, forKey: "cohortDescription")
+
+ cohort.setValue(members.text, forKey: "cohortMembers")
+
+ var ageGroup = ageFrom.text + " - " + ageTo.text
+ cohort.setValue(ageGroup, forKey: "cohortAgeGroup")
+ cohort.setValue(maleMembers.text, forKey: "cohortMaleMembers")
+ cohort.setValue(femaleMembers.text, forKey: "cohortFemaleMembers")
+ cohort.setValue(commPosition.text, forKey: "cohortCommPosition")
+ cohort.setValue(notes.text, forKey: "cohortNotes")
+
+
+ var error: NSError?
+ if !managedContext.save(&error) {
+ println("Could not save \(error), \(error?.userInfo)")
+ }
+
+ }
+
+ func putCohortToVolunteerList(jsonData: NSDictionary) {
+ // set up the base64-encoded credentials
+ let username = "admin"
+ let password = "mypassword"
+ let loginString = NSString(format: "%@:%@", username, password)
+ let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
+ let base64LoginString = loginData.base64EncodedStringWithOptions(nil)
+
+ let volunteerId = 1
+
+ NSLog("Response ==> %@", jsonData);
+
+ // Request URL
+ var url:NSURL = NSURL(string: "http://10.2.194.247:8001/api/volunteer/" + String(volunteerId) + "/")!
+ var request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
+ request.HTTPMethod = "PUT"
+
+ var err: NSError?
+ request.HTTPBody = NSJSONSerialization.dataWithJSONObject(jsonData, options: nil, error: &err)
+ request.setValue("Basic \(base64LoginString)", forHTTPHeaderField: "Authorization")
+ request.setValue("application/json", forHTTPHeaderField: "Accept")
+ request.setValue("application/json", forHTTPHeaderField: "Content-Type")
+
+ var responseError: NSError?
+ var response: NSURLResponse?
+
+ var urlData: NSData? = NSURLConnection.sendSynchronousRequest(request, returningResponse:&response, error:&responseError)
+
+ if ( urlData != nil ) {
+ let res = response as! NSHTTPURLResponse!;
+ NSLog("Response code: %1d", res.statusCode);
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ var responseData:NSString = NSString(data:urlData!, encoding:NSUTF8StringEncoding)!
+ NSLog("Response ==> %@", responseData);
+ var error: NSError?
+// let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers, error: &error) as! NSDictionary
+//
+// var vol_cohorts:NSMutableArray = jsonData.valueForKey("vol_cohort") as! NSMutableArray
+// vol_cohorts.addObject(id)
+// jsonData.setValue(vol_cohorts, forKey: "vol_cohort")
+// self.postCohortToVolunteerList(jsonData)
+
+ } else {
+ // Connection failed!
+ }
+ } else {
+ }
+
+ }
+
+ func getVolunteerDetails(id: NSInteger) {
+
+ // set up the base64-encoded credentials
+ let username = "admin"
+ let password = "mypassword"
+ let loginString = NSString(format: "%@:%@", username, password)
+ let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
+ let base64LoginString = loginData.base64EncodedStringWithOptions(nil)
+
+ let volunteerId = 1
+
+ // Request URL
+ var url:NSURL = NSURL(string: "http://10.2.194.247:8001/api/volunteer/" + String(volunteerId) + "/")!
+ var request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
+ request.HTTPMethod = "GET"
+
+ request.setValue("Basic \(base64LoginString)", forHTTPHeaderField: "Authorization")
+ request.setValue("application/json", forHTTPHeaderField: "Accept")
+ request.setValue("application/json", forHTTPHeaderField: "Content-Type")
+
+ var responseError: NSError?
+ var response: NSURLResponse?
+
+ var urlData: NSData? = NSURLConnection.sendSynchronousRequest(request, returningResponse:&response, error:&responseError)
+
+ if ( urlData != nil ) {
+ let res = response as! NSHTTPURLResponse!;
+ NSLog("Response code: %1d", res.statusCode);
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ var responseData:NSString = NSString(data:urlData!, encoding:NSUTF8StringEncoding)!
+ NSLog("Response ==> %@", responseData);
+ var error: NSError?
+ let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers, error: &error) as! NSDictionary
+
+ var vol_cohorts:NSMutableArray = jsonData.valueForKey("vol_cohort") as! NSMutableArray
+ vol_cohorts.addObject(id)
+ jsonData.setValue(vol_cohorts, forKey: "vol_cohort")
+ self.putCohortToVolunteerList(jsonData)
+
+ } else {
+ // Connection failed!
+ }
+ } else {
+ }
+
+
+ }
+
+ func saveToServer() {
+ // set up the base64-encoded credentials
+ let username = "admin"
+ let password = "mypassword"
+ let loginString = NSString(format: "%@:%@", username, password)
+ let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
+ let base64LoginString = loginData.base64EncodedStringWithOptions(nil)
+
+ // Request URL
+ var url:NSURL = NSURL(string: "http://10.2.194.247:8001/api/cohort/")!
+ var request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
+ request.HTTPMethod = "POST"
+
+ var params = ["cohort_name":"jameson", "cohort_desc":"password", "cohort_no_of_members":127, "cohort_age":"23", "cohort_males": 231, "cohort_females": 705, "cohort_pos": "positions", "cohort_notes": "notes"] as Dictionary
+
+ var err: NSError?
+ request.HTTPBody = NSJSONSerialization.dataWithJSONObject(params, options: nil, error: &err)
+ request.setValue("Basic \(base64LoginString)", forHTTPHeaderField: "Authorization")
+ request.setValue("application/json", forHTTPHeaderField: "Accept")
+ request.setValue("application/json", forHTTPHeaderField: "Content-Type")
+
+
+ var responseError: NSError?
+ var response: NSURLResponse?
+
+ var urlData: NSData? = NSURLConnection.sendSynchronousRequest(request, returningResponse:&response, error:&responseError)
+
+ if ( urlData != nil ) {
+ let res = response as! NSHTTPURLResponse!;
+ NSLog("Response code: %1d", res.statusCode);
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ var responseData:NSString = NSString(data:urlData!, encoding:NSUTF8StringEncoding)!
+ NSLog("Response ==> %@", responseData);
+ var error: NSError?
+ let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers, error: &error) as! NSDictionary
+ let id:NSInteger = jsonData.valueForKey("id") as! NSInteger
+ NSLog("Success: %ld", id);
+ self.getVolunteerDetails(id)
+ } else {
+ // Connection failed!
+ }
+ } else {
+ }
+
+ }
+
+}
diff --git a/PeaceTrack/AddMeasurementViewController.swift b/PeaceTrack/AddMeasurementViewController.swift
new file mode 100644
index 0000000..b5a190b
--- /dev/null
+++ b/PeaceTrack/AddMeasurementViewController.swift
@@ -0,0 +1,141 @@
+//
+// AddMeasurementViewController.swift
+// PeaceTrack
+//
+// Created by apple on 8/18/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class AddMeasurementViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
+
+ @IBOutlet weak var measurementName: UITextField!
+ @IBOutlet weak var measurementDesc: UITextField!
+ @IBOutlet weak var cohortSelectTextField: UITextField!
+ @IBOutlet weak var outcomeSelectTextField: UITextField!
+ @IBOutlet weak var outcomeData: UITextField!
+
+
+ var cohortOptions = [String]()
+ var outcomeOptions = ["Outcome1", "Outcome2", "Outcome3", "Outcome4"]
+ var cohorts = [NSManagedObject]()
+ var pickerViewType = ""
+
+ @IBAction func cohortOptionsSelect(sender: UITextField) {
+ if(sender.restorationIdentifier=="cohortSelectField") {
+ pickerViewType = "cohort"
+ var cohortPickerView = UIPickerView()
+ cohortPickerView.delegate = self
+ cohortSelectTextField.inputView = cohortPickerView
+ }
+ }
+
+ @IBAction func outcomeOptionsSelect(sender: UITextField) {
+
+ if(sender.restorationIdentifier=="outcomeSelectField") {
+ pickerViewType = "outcome"
+ var outcomePickerView = UIPickerView()
+ outcomePickerView.delegate = self
+ outcomeSelectTextField.inputView = outcomePickerView
+ }
+
+ }
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let fetchRequest = NSFetchRequest(entityName: "Cohort")
+
+ var error: NSError?
+
+ let fetchedResults = managedContext.executeFetchRequest(fetchRequest, error: &error) as? [NSManagedObject]
+
+ let results = fetchedResults
+
+ cohortOptions.removeAll(keepCapacity: false);
+ if (results != nil) {
+ cohorts = results!
+ for (var i=0;i Int {
+ return 1
+ }
+
+ func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
+ if(pickerViewType=="cohort") {
+ return cohortOptions.count
+ } else {
+ return outcomeOptions.count
+ }
+ }
+
+ func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
+ if(pickerViewType=="cohort") {
+ return cohortOptions[row]
+ } else {
+ return outcomeOptions[row]
+ }
+ }
+
+ func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
+ if(pickerViewType=="cohort") {
+ cohortSelectTextField.text = cohortOptions[row]
+ } else {
+ outcomeSelectTextField.text = outcomeOptions[row]
+ }
+ }
+
+
+ @IBAction func measurementSaveTapped(sender: AnyObject) {
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let entity = NSEntityDescription.entityForName("Measurement", inManagedObjectContext: managedContext)
+
+ let measurement = NSManagedObject(entity: entity!, insertIntoManagedObjectContext: managedContext)
+
+ measurement.setValue(measurementName.text, forKey: "name")
+ measurement.setValue(measurementDesc.text, forKey: "measurementDescription")
+ measurement.setValue(cohortSelectTextField.text, forKey: "measurementCohort")
+ measurement.setValue(outcomeSelectTextField.text, forKey: "measurementOutcome")
+ measurement.setValue(outcomeData.text, forKey: "outcomeData")
+
+ var error: NSError?
+ if !managedContext.save(&error) {
+ println("Could not save \(error), \(error?.userInfo)")
+ }
+
+ navigationController?.popViewControllerAnimated(true)
+
+ }
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
diff --git a/PeaceTrack/AppDelegate.swift b/PeaceTrack/AppDelegate.swift
new file mode 100644
index 0000000..78b6cda
--- /dev/null
+++ b/PeaceTrack/AppDelegate.swift
@@ -0,0 +1,111 @@
+//
+// AppDelegate.swift
+// PeaceTrack
+//
+// Created by apple on 6/26/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+ var window: UIWindow?
+
+
+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> 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 throttle down OpenGL ES frame rates. 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.
+ }
+
+ func applicationWillEnterForeground(application: UIApplication) {
+ // Called as part of the transition from the background to the inactive 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:.
+ self.saveContext()
+ }
+
+
+ // MARK: - Core Data stack
+
+ lazy var applicationDocumentsDirectory: NSURL = {
+ // The directory the application uses to store the Core Data store file. This code uses a directory named "com.xxxx.ProjectName" in the application's documents Application Support directory.
+ let urls = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
+ return urls[urls.count-1] as! NSURL
+ }()
+
+ lazy var managedObjectModel: NSManagedObjectModel = {
+ // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
+ let modelURL = NSBundle.mainBundle().URLForResource("Model", withExtension: "momd")!
+ return NSManagedObjectModel(contentsOfURL: modelURL)!
+ }()
+
+ lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator? = {
+ // The persistent store coordinator for the application. This implementation creates and return a coordinator, having added 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.
+ // Create the coordinator and store
+ var coordinator: NSPersistentStoreCoordinator? = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
+ let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("PeaceTrack.sqlite")
+ var error: NSError? = nil
+ var failureReason = "There was an error creating or loading the application's saved data."
+ if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: nil, error: &error) == nil {
+ coordinator = nil
+ // Report any error we got.
+ var dict = [String: AnyObject]()
+ dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
+ dict[NSLocalizedFailureReasonErrorKey] = failureReason
+ dict[NSUnderlyingErrorKey] = error
+ error = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
+ // Replace this with code to handle the error appropriately.
+ // abort() 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.
+ NSLog("Unresolved error \(error), \(error!.userInfo)")
+ abort()
+ }
+
+ return coordinator
+ }()
+
+ lazy var managedObjectContext: NSManagedObjectContext? = {
+ // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
+ let coordinator = self.persistentStoreCoordinator
+ if coordinator == nil {
+ return nil
+ }
+ var managedObjectContext = NSManagedObjectContext()
+ managedObjectContext.persistentStoreCoordinator = coordinator
+ return managedObjectContext
+ }()
+
+ // MARK: - Core Data Saving support
+
+ func saveContext () {
+ if let moc = self.managedObjectContext {
+ var error: NSError? = nil
+ if moc.hasChanges && !moc.save(&error) {
+ // Replace this implementation with code to handle the error appropriately.
+ // abort() 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.
+ NSLog("Unresolved error \(error), \(error!.userInfo)")
+ abort()
+ }
+ }
+ }
+
+}
+
diff --git a/PeaceTrack/Base.lproj/LaunchScreen.xib b/PeaceTrack/Base.lproj/LaunchScreen.xib
new file mode 100644
index 0000000..cb3c102
--- /dev/null
+++ b/PeaceTrack/Base.lproj/LaunchScreen.xib
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PeaceTrack/Base.lproj/Main.storyboard b/PeaceTrack/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..e2fb945
--- /dev/null
+++ b/PeaceTrack/Base.lproj/Main.storyboard
@@ -0,0 +1,1568 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PeaceTrack/CohortDetailViewController.swift b/PeaceTrack/CohortDetailViewController.swift
new file mode 100644
index 0000000..0c668ca
--- /dev/null
+++ b/PeaceTrack/CohortDetailViewController.swift
@@ -0,0 +1,66 @@
+//
+// CohortDetailViewController.swift
+// PeaceTrack
+//
+// Created by apple on 7/13/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class CohortDetailViewController: UIViewController {
+
+
+ @IBOutlet weak var cohortNameLabel: UILabel!
+ @IBOutlet weak var cohortDescriptionLabel: UILabel!
+
+ @IBOutlet weak var cohortMembers: UILabel!
+ @IBOutlet weak var cohortAgeGroup: UILabel!
+ @IBOutlet weak var cohortMales: UILabel!
+ @IBOutlet weak var cohortFemales: UILabel!
+ @IBOutlet weak var cohortPosition: UILabel!
+ @IBOutlet weak var cohortNotes: UILabel!
+// var cohort = NSManagedObject()
+ var name: String = ""
+ var cohortDescription: String = ""
+ var members: String = ""
+ var ageGroup: String = ""
+ var males: String = ""
+ var females: String = ""
+ var position: String = ""
+ var notes: String = ""
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ cohortNameLabel.text = name
+ cohortDescriptionLabel.text = cohortDescription
+ cohortAgeGroup.text = ageGroup
+ cohortMales.text = males
+ cohortFemales.text = females
+ cohortPosition.text = position
+ cohortNotes.text = notes
+ cohortMembers.text = members
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+ @IBAction func deleteCohortTapped(sender: AnyObject) {
+
+ }
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
diff --git a/PeaceTrack/CohortsTableViewController.swift b/PeaceTrack/CohortsTableViewController.swift
new file mode 100644
index 0000000..3d4f17b
--- /dev/null
+++ b/PeaceTrack/CohortsTableViewController.swift
@@ -0,0 +1,204 @@
+//
+// CohortsTableViewController.swift
+// PeaceTrack
+//
+// Created by apple on 7/13/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class CohortsTableViewController: UITableViewController, UISearchResultsUpdating {
+
+ var foodNames: [String] = ["Food1","Food2","Food3","Food4","Food5","Food6","Food7","Food8"];
+
+ var tableData = [String]()
+
+ var filteredTableData = [String]()
+
+ var resultSearchController = UISearchController()
+
+
+ var cohorts = [NSManagedObject]()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ self.resultSearchController = ({
+ let controller = UISearchController(searchResultsController: nil)
+ controller.searchResultsUpdater = self
+ controller.dimsBackgroundDuringPresentation = false
+ controller.searchBar.sizeToFit()
+
+ self.tableView.tableHeaderView = controller.searchBar
+
+ return controller
+ })()
+
+ self.tableView.reloadData()
+ // Uncomment the following line to preserve selection between presentations
+ // self.clearsSelectionOnViewWillAppear = false
+
+ // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+ // self.navigationItem.rightBarButtonItem = self.editButtonItem()
+ }
+
+ override func viewDidAppear(animated: Bool) {
+ super.viewDidAppear(true)
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let fetchRequest = NSFetchRequest(entityName: "Cohort")
+
+ var error: NSError?
+
+ let fetchedResults = managedContext.executeFetchRequest(fetchRequest, error: &error) as? [NSManagedObject]
+
+ let results = fetchedResults
+
+ tableData.removeAll(keepCapacity: false);
+ if (results != nil) {
+ cohorts = results!
+ for (var i=0;i Int {
+ // #warning Potentially incomplete method implementation.
+ // Return the number of sections.
+ return 1
+ }
+
+ override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+ // #warning Incomplete method implementation.
+ // Return the number of rows in the section.
+// return foodNames.count
+
+ if (self.resultSearchController.active) {
+ return self.filteredTableData.count
+ } else {
+ return cohorts.count
+ }
+ }
+
+
+ override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
+ let cell = tableView.dequeueReusableCellWithIdentifier("CohortCell", forIndexPath: indexPath) as! UITableViewCell
+
+ if (self.resultSearchController.active) {
+ cell.textLabel?.text = filteredTableData[indexPath.row]
+
+ return cell
+ } else {
+ let cohort = cohorts[indexPath.row]
+ cell.textLabel?.text = cohort.valueForKey("name") as? String
+
+ return cell
+
+ }
+
+ }
+
+ func updateSearchResultsForSearchController(searchController: UISearchController) {
+ filteredTableData.removeAll(keepCapacity: false)
+
+ let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text)
+
+ let array = (tableData as NSArray).filteredArrayUsingPredicate(searchPredicate)
+ filteredTableData = array as! [String]
+
+ self.tableView.reloadData()
+ }
+
+
+ /*
+ // Override to support conditional editing of the table view.
+ override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
+ // Return NO if you do not want the specified item to be editable.
+ return true
+ }
+ */
+
+ /*
+ // Override to support editing the table view.
+ override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
+ if editingStyle == .Delete {
+ // Delete the row from the data source
+ tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
+ } else if editingStyle == .Insert {
+ // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
+ }
+ }
+ */
+
+ /*
+ // Override to support rearranging the table view.
+ override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
+
+ }
+ */
+
+ /*
+ // Override to support conditional rearranging of the table view.
+ override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
+ // Return NO if you do not want the item to be re-orderable.
+ return true
+ }
+ */
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+ override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
+// performSegueWithIdentifier("cohortDetail", sender: tableView)
+ }
+
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ if segue.identifier == "cohortDetail" {
+ let indexPath:NSIndexPath = self.tableView.indexPathForSelectedRow()!
+ let cohortDetailVC:CohortDetailViewController = segue.destinationViewController as! CohortDetailViewController
+
+ let cohort = cohorts[indexPath.row]
+ cohortDetailVC.name = (cohort.valueForKey("name") as? String)!
+ cohortDetailVC.cohortDescription = (cohort.valueForKey("cohortDescription") as? String)!
+ cohortDetailVC.members = (cohort.valueForKey("cohortMembers") as? String)!
+ cohortDetailVC.ageGroup = (cohort.valueForKey("cohortAgeGroup") as? String)!
+ cohortDetailVC.position = (cohort.valueForKey("cohortCommPosition") as? String)!
+ cohortDetailVC.females = (cohort.valueForKey("cohortFemaleMembers") as? String)!
+ cohortDetailVC.males = (cohort.valueForKey("cohortMaleMembers") as? String)!
+ cohortDetailVC.notes = (cohort.valueForKey("cohortNotes") as? String)!
+
+
+
+ }
+ }
+}
diff --git a/PeaceTrack/Images.xcassets/AppIcon.appiconset/Contents.json b/PeaceTrack/Images.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..36d2c80
--- /dev/null
+++ b/PeaceTrack/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,68 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/PeaceTrack/Images.xcassets/Image.imageset/Contents.json b/PeaceTrack/Images.xcassets/Image.imageset/Contents.json
new file mode 100644
index 0000000..f8f827e
--- /dev/null
+++ b/PeaceTrack/Images.xcassets/Image.imageset/Contents.json
@@ -0,0 +1,20 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/PeaceTrack/Images.xcassets/peacetrack_logo.imageset/Contents.json b/PeaceTrack/Images.xcassets/peacetrack_logo.imageset/Contents.json
new file mode 100644
index 0000000..751245b
--- /dev/null
+++ b/PeaceTrack/Images.xcassets/peacetrack_logo.imageset/Contents.json
@@ -0,0 +1,13 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "scale" : "1x",
+ "filename" : "peacetrack_logo.png"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/PeaceTrack/Images.xcassets/peacetrack_logo.imageset/peacetrack_logo.png b/PeaceTrack/Images.xcassets/peacetrack_logo.imageset/peacetrack_logo.png
new file mode 100644
index 0000000..2ccb6f5
Binary files /dev/null and b/PeaceTrack/Images.xcassets/peacetrack_logo.imageset/peacetrack_logo.png differ
diff --git a/PeaceTrack/Info.plist b/PeaceTrack/Info.plist
new file mode 100644
index 0000000..ef881b3
--- /dev/null
+++ b/PeaceTrack/Info.plist
@@ -0,0 +1,47 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ com.systers.$(PRODUCT_NAME:rfc1034identifier)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/PeaceTrack/LoginViewController.swift b/PeaceTrack/LoginViewController.swift
new file mode 100644
index 0000000..34d45c3
--- /dev/null
+++ b/PeaceTrack/LoginViewController.swift
@@ -0,0 +1,283 @@
+//
+// LoginViewController.swift
+// PeaceTrack
+//
+// Created by apple on 6/26/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+
+class LoginViewController: UIViewController, UIPickerViewDelegate {
+
+// var post: [String] = []
+ var posts: [[String:String]] = []
+
+
+ var sectors: [[String:String]] = []
+
+ func getPosts() {
+ // set up the base64-encoded credentials
+ let username = "admin"
+ let password = "mypassword"
+ let loginString = NSString(format: "%@:%@", username, password)
+ let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
+ let base64LoginString = loginData.base64EncodedStringWithOptions(nil)
+ // Request URL
+ var url:NSURL = NSURL(string: "http://10.2.194.247:8001/api/ptposts/?format=json")!
+ var request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
+ request.HTTPMethod = "GET"
+ request.setValue("Basic \(base64LoginString)", forHTTPHeaderField: "Authorization")
+ request.setValue("application/json", forHTTPHeaderField: "Accept")
+
+
+ var responseError: NSError?
+ var response: NSURLResponse?
+
+ var urlData: NSData? = NSURLConnection.sendSynchronousRequest(request, returningResponse:&response, error:&responseError)
+
+ if ( urlData != nil ) {
+ let res = response as! NSHTTPURLResponse!;
+ NSLog("Response code: %1d", res.statusCode);
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ var responseData:NSString = NSString(data:urlData!, encoding:NSUTF8StringEncoding)!
+ NSLog("Response ==> %@", responseData);
+ var error: NSError?
+ let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers, error: &error) as! NSDictionary
+ let count:NSInteger = jsonData.valueForKey("count") as! NSInteger
+ NSLog("Success: %ld", count);
+ let results:NSArray = jsonData.valueForKey("results") as! NSArray
+
+ for result in results {
+ var fResult:String = result.valueForKey("post_name") as! String
+ var fId:NSInteger = result.valueForKey("id") as! NSInteger
+ var fIdString = String(fId)
+
+ var postDict = ["post_name": fResult, "id": fIdString]
+ posts.append(postDict)
+// post.append(fResult as String)
+ NSLog("Post ==> %@", fResult);
+ }
+ } else {
+ // Connection failed!
+ }
+ } else {
+ }
+
+ }
+
+ func getSectors(id: String) {
+ // set up the base64-encoded credentials
+ let username = "admin"
+ let password = "mypassword"
+ let loginString = NSString(format: "%@:%@", username, password)
+ let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
+ let base64LoginString = loginData.base64EncodedStringWithOptions(nil)
+ // Request URL
+ var url:NSURL = NSURL(string: "http://10.2.194.247:8001/api/ptposts/?post_sectors=True&id=" + id + "&format=json")!
+ var request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
+ request.HTTPMethod = "GET"
+ request.setValue("Basic \(base64LoginString)", forHTTPHeaderField: "Authorization")
+ request.setValue("application/json", forHTTPHeaderField: "Accept")
+
+
+ var responseError: NSError?
+ var response: NSURLResponse?
+
+ var urlData: NSData? = NSURLConnection.sendSynchronousRequest(request, returningResponse:&response, error:&responseError)
+
+ if ( urlData != nil ) {
+ let res = response as! NSHTTPURLResponse!;
+ NSLog("Response code: %1d", res.statusCode);
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ var responseData:NSString = NSString(data:urlData!, encoding:NSUTF8StringEncoding)!
+ NSLog("Response ==> %@", responseData);
+ var error: NSError?
+ let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers, error: &error) as! NSDictionary
+ let count:NSInteger = jsonData.valueForKey("count") as! NSInteger
+ NSLog("Success: %ld", count);
+ let results:NSArray = jsonData.valueForKey("results") as! NSArray
+
+ for result in results {
+ var fResult:String = result.valueForKey("sector_name") as! String
+ var fId:NSInteger = result.valueForKey("id") as! NSInteger
+ var fIdString = String(fId)
+
+ var sectorDict = ["sector_name": fResult, "id": fIdString]
+ sectors.append(sectorDict)
+ NSLog("Sector ==> %@", fResult);
+ }
+ } else {
+ // Connection failed!
+ }
+ } else {
+ }
+
+ }
+
+ @IBOutlet weak var txtUsername: UITextField!
+
+ @IBOutlet weak var postTextField: UITextField!
+ @IBOutlet weak var sectorTextField: UITextField!
+
+ // Here Password === Email
+ @IBOutlet weak var txtPassword: UITextField!
+
+ var pickerViewType = ""
+
+
+ @IBAction func selectPost(sender: UITextField) {
+ if(sender.restorationIdentifier=="postSelectField") {
+ pickerViewType = "post"
+ var postPickerView = UIPickerView()
+ postPickerView.delegate = self
+ postTextField.inputView = postPickerView
+ }
+ }
+
+ @IBAction func selectSector(sender: UITextField) {
+ if(sender.restorationIdentifier=="sectorSelectField") {
+ pickerViewType = "sector"
+ var sectorPickerView = UIPickerView()
+ sectorPickerView.delegate = self
+ sectorTextField.inputView = sectorPickerView
+ }
+
+ }
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ // Do any additional setup after loading the view.
+ getPosts()
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+ @IBAction func signinTapped(sender: UIButton) {
+ self.volunteerValidate()
+ }
+
+ func volunteerValidate() {
+ // set up the base64-encoded credentials
+ let username = "admin"
+ let password = "mypassword"
+ let loginString = NSString(format: "%@:%@", username, password)
+ let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
+ let base64LoginString = loginData.base64EncodedStringWithOptions(nil)
+
+ var postId:String = ""
+ var sectorId:String = ""
+ for dict in posts {
+ if(dict["post_name"] == postTextField.text) {
+ postId = dict["id"]!
+ break
+ }
+ }
+ for dict in sectors {
+ if(dict["sector_name"] == sectorTextField.text) {
+ sectorId = dict["id"]!
+ break
+ }
+ }
+
+ let name = txtUsername.text.stringByReplacingOccurrencesOfString(" ", withString: "%20", options: nil, range: nil)
+ let email = txtPassword.text
+ let pID = postId
+ let sID = sectorId
+
+ let finalURL = "http://10.2.194.247:8001/api/volunteer/?format=json&vol_name=\(name)&vol_email=\(email)&vol_ptpost=\(pID)&vol_sector=\(sID)"
+
+ NSLog("URL String: %@", finalURL);
+
+ // Request URL
+ var url:NSURL = NSURL(string: finalURL)!
+
+ var request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
+ request.HTTPMethod = "GET"
+
+ request.setValue("Basic \(base64LoginString)", forHTTPHeaderField: "Authorization")
+ request.setValue("application/json", forHTTPHeaderField: "Accept")
+ request.setValue("application/json", forHTTPHeaderField: "Content-Type")
+
+
+ var responseError: NSError?
+ var response: NSURLResponse?
+
+ var urlData: NSData? = NSURLConnection.sendSynchronousRequest(request, returningResponse:&response, error:&responseError)
+
+ if ( urlData != nil ) {
+ let res = response as! NSHTTPURLResponse!;
+ NSLog("Response code: %1d", res.statusCode);
+ if (res.statusCode >= 200 && res.statusCode < 300) {
+ var responseData:NSString = NSString(data:urlData!, encoding:NSUTF8StringEncoding)!
+ NSLog("Response ==> %@", responseData);
+
+ var error: NSError?
+ let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!, options:NSJSONReadingOptions.MutableContainers, error: &error) as! NSDictionary
+ let count:NSInteger = jsonData.valueForKey("count") as! NSInteger
+ NSLog("Success: %ld", count);
+ let results:NSArray = jsonData.valueForKey("results") as! NSArray
+
+ for result in results {
+ var volunteerId:NSInteger = result.valueForKey("id") as! NSInteger
+ var volunteerIdString = String(volunteerId)
+
+ let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults()
+ prefs.setInteger(1, forKey: "ISLOGGEDIN")
+ prefs.setInteger(volunteerId, forKey: "USERID")
+ navigationController?.popViewControllerAnimated(true)
+ }
+
+
+ } else {
+ // Connection failed!
+ }
+ } else {
+ }
+ }
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+
+ // PickerView Post data Delegate functions
+ func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int {
+ return 1
+ }
+
+ func pickerView(pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int {
+ if (pickerViewType == "post") {
+ return posts.count
+ } else {
+ return sectors.count
+ }
+ }
+
+ func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
+ if (pickerViewType == "post") {
+ return posts[row]["post_name"]
+ } else {
+ return sectors[row]["sector_name"]
+ }
+ }
+
+ func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
+ if(pickerViewType=="post") {
+ postTextField.text = posts[row]["post_name"]
+ sectors.removeAll(keepCapacity: false)
+ getSectors(posts[row]["id"]!)
+ } else {
+ sectorTextField.text = sectors[row]["sector_name"]
+ }
+ }
+}
diff --git a/PeaceTrack/MeasurementDetailViewController.swift b/PeaceTrack/MeasurementDetailViewController.swift
new file mode 100644
index 0000000..22ea080
--- /dev/null
+++ b/PeaceTrack/MeasurementDetailViewController.swift
@@ -0,0 +1,51 @@
+//
+// MeasurementDetailViewController.swift
+// PeaceTrack
+//
+// Created by apple on 8/18/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+
+class MeasurementDetailViewController: UIViewController {
+
+ @IBOutlet weak var measurementName: UILabel!
+ @IBOutlet weak var measurementCohort: UILabel!
+ @IBOutlet weak var measurementOutcome: UILabel!
+ @IBOutlet weak var measurementOutcomeData: UILabel!
+ @IBOutlet weak var measurementDesc: UILabel!
+
+ var name: String = ""
+ var cohort: String = ""
+ var outcome: String = ""
+ var outcomeData: String = ""
+ var desc: String = ""
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ measurementName.text = name
+ measurementCohort.text = cohort
+ measurementOutcome.text = outcome
+ measurementOutcomeData.text = outcomeData
+ measurementDesc.text = desc
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
diff --git a/PeaceTrack/MeasurementTableViewController.swift b/PeaceTrack/MeasurementTableViewController.swift
new file mode 100644
index 0000000..d47729a
--- /dev/null
+++ b/PeaceTrack/MeasurementTableViewController.swift
@@ -0,0 +1,195 @@
+//
+// MeasurementTableViewController.swift
+// PeaceTrack
+//
+// Created by apple on 8/18/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import CoreData
+
+class MeasurementTableViewController: UITableViewController, UISearchResultsUpdating {
+
+
+ var tableData = [String]()
+
+ var filteredTableData = [String]()
+
+ var resultSearchController = UISearchController()
+
+
+ var measurements = [NSManagedObject]()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ self.resultSearchController = ({
+ let controller = UISearchController(searchResultsController: nil)
+ controller.searchResultsUpdater = self
+ controller.dimsBackgroundDuringPresentation = false
+ controller.searchBar.sizeToFit()
+
+ self.tableView.tableHeaderView = controller.searchBar
+
+ return controller
+ })()
+
+ self.tableView.reloadData()
+
+ // Uncomment the following line to preserve selection between presentations
+ // self.clearsSelectionOnViewWillAppear = false
+
+ // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+ // self.navigationItem.rightBarButtonItem = self.editButtonItem()
+ }
+
+ override func viewDidAppear(animated: Bool) {
+ super.viewDidAppear(true)
+
+ let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
+
+ let managedContext = appDelegate.managedObjectContext!
+
+ let fetchRequest = NSFetchRequest(entityName: "Measurement")
+
+ var error: NSError?
+
+ let fetchedResults = managedContext.executeFetchRequest(fetchRequest, error: &error) as? [NSManagedObject]
+
+ let results = fetchedResults
+
+ tableData.removeAll(keepCapacity: false);
+ if (results != nil) {
+ measurements = results!
+ for (var i=0;i Int {
+ // #warning Potentially incomplete method implementation.
+ // Return the number of sections.
+ return 1
+ }
+
+ override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+ // #warning Incomplete method implementation.
+ // Return the number of rows in the section.
+ if (self.resultSearchController.active) {
+ return self.filteredTableData.count
+ } else {
+ return measurements.count
+ }
+ }
+
+
+ override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
+ let cell = tableView.dequeueReusableCellWithIdentifier("MeasurementCell", forIndexPath: indexPath) as! UITableViewCell
+
+ if (self.resultSearchController.active) {
+ cell.textLabel?.text = filteredTableData[indexPath.row]
+
+ return cell
+ } else {
+ let measurement = measurements[indexPath.row]
+ cell.textLabel?.text = measurement.valueForKey("name") as? String
+
+ return cell
+
+ }
+
+ }
+
+ func updateSearchResultsForSearchController(searchController: UISearchController) {
+ filteredTableData.removeAll(keepCapacity: false)
+
+ let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text)
+
+ let array = (tableData as NSArray).filteredArrayUsingPredicate(searchPredicate)
+ filteredTableData = array as! [String]
+
+ self.tableView.reloadData()
+ }
+
+
+
+ /*
+ // Override to support conditional editing of the table view.
+ override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
+ // Return NO if you do not want the specified item to be editable.
+ return true
+ }
+ */
+
+ /*
+ // Override to support editing the table view.
+ override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
+ if editingStyle == .Delete {
+ // Delete the row from the data source
+ tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
+ } else if editingStyle == .Insert {
+ // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
+ }
+ }
+ */
+
+ /*
+ // Override to support rearranging the table view.
+ override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
+
+ }
+ */
+
+ /*
+ // Override to support conditional rearranging of the table view.
+ override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
+ // Return NO if you do not want the item to be re-orderable.
+ return true
+ }
+ */
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ if segue.identifier == "measurementDetail" {
+ let indexPath:NSIndexPath = self.tableView.indexPathForSelectedRow()!
+ let measurementDetailVC:MeasurementDetailViewController = segue.destinationViewController as! MeasurementDetailViewController
+
+ let measurement = measurements[indexPath.row]
+ measurementDetailVC.name = (measurement.valueForKey("name") as? String)!
+ measurementDetailVC.desc = (measurement.valueForKey("measurementDescription") as? String)!
+ measurementDetailVC.cohort = (measurement.valueForKey("measurementCohort") as? String)!
+ measurementDetailVC.outcome = (measurement.valueForKey("measurementOutcome") as? String)!
+ measurementDetailVC.outcomeData = (measurement.valueForKey("outcomeData") as? String)!
+
+ }
+ }
+
+}
diff --git a/PeaceTrack/NavViewController.swift b/PeaceTrack/NavViewController.swift
new file mode 100644
index 0000000..a8cb535
--- /dev/null
+++ b/PeaceTrack/NavViewController.swift
@@ -0,0 +1,38 @@
+//
+// NavViewController.swift
+// PeaceTrack
+//
+// Created by apple on 6/28/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+
+class NavViewController: UINavigationController {
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ // Do any additional setup after loading the view.
+ // Status bar white font
+ self.navigationBar.barStyle = UIBarStyle.Black
+ self.navigationBar.tintColor = UIColor.whiteColor()
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+
+ /*
+ // MARK: - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
+ // Get the new view controller using segue.destinationViewController.
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
diff --git a/PeaceTrack/ViewController.swift b/PeaceTrack/ViewController.swift
new file mode 100644
index 0000000..f2344fd
--- /dev/null
+++ b/PeaceTrack/ViewController.swift
@@ -0,0 +1,49 @@
+//
+// ViewController.swift
+// PeaceTrack
+//
+// Created by apple on 6/26/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+
+class ViewController: UIViewController {
+
+ @IBOutlet weak var usernameLabel: UILabel!
+ 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.
+ }
+
+ override func viewDidAppear(animated: Bool) {
+
+ let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults()
+ let isLoggedIn:Int = prefs.integerForKey("ISLOGGEDIN") as Int
+
+ /* Verified UserId need from MACC */
+
+ if (isLoggedIn != 1) {
+ self.performSegueWithIdentifier("goto_login", sender: self)
+ } else {
+// self.usernameLabel.text = prefs.valueForKey("USERNAME") as! NSString as String
+ }
+ }
+
+ /* Logout code here */
+
+ @IBAction func logoutTapped(sender: UIButton) {
+
+ let appDomain = NSBundle.mainBundle().bundleIdentifier
+ NSUserDefaults.standardUserDefaults().removePersistentDomainForName(appDomain!)
+
+ self.performSegueWithIdentifier("goto_login", sender: self)
+ }
+
+}
+
diff --git a/Info.plist b/PeaceTrackTests/Info.plist
old mode 100755
new mode 100644
similarity index 64%
rename from Info.plist
rename to PeaceTrackTests/Info.plist
index 9404023..2723ca4
--- a/Info.plist
+++ b/PeaceTrackTests/Info.plist
@@ -5,28 +5,20 @@
CFBundleDevelopmentRegion
en
CFBundleExecutable
- ${EXECUTABLE_NAME}
+ $(EXECUTABLE_NAME)
CFBundleIdentifier
- my.${PRODUCT_NAME:rfc1034identifier}
+ com.systers.$(PRODUCT_NAME:rfc1034identifier)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- ${PRODUCT_NAME}
+ $(PRODUCT_NAME)
CFBundlePackageType
- APPL
+ BNDL
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1
- LSRequiresIPhoneOS
-
- UIMainStoryboardFile
- Main
- UIRequiredDeviceCapabilities
-
- armv7
-
diff --git a/PeaceTrackTests/PeaceTrackTests.swift b/PeaceTrackTests/PeaceTrackTests.swift
new file mode 100644
index 0000000..eba3ffa
--- /dev/null
+++ b/PeaceTrackTests/PeaceTrackTests.swift
@@ -0,0 +1,36 @@
+//
+// PeaceTrackTests.swift
+// PeaceTrackTests
+//
+// Created by apple on 6/26/15.
+// Copyright (c) 2015 Systers. All rights reserved.
+//
+
+import UIKit
+import XCTest
+
+class PeaceTrackTests: 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.
+ XCTAssert(true, "Pass")
+ }
+
+ func testPerformanceExample() {
+ // This is an example of a performance test case.
+ self.measureBlock() {
+ // Put the code you want to measure the time of here.
+ }
+ }
+
+}
diff --git a/Property List.plist b/Property List.plist
deleted file mode 100755
index d13fef7..0000000
--- a/Property List.plist
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- Albania
- Armenia
- Azerbaijan
-
-
diff --git a/TaskDetailViewController.swift b/TaskDetailViewController.swift
deleted file mode 100755
index 38b226d..0000000
--- a/TaskDetailViewController.swift
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// TaskDetailViewController.swift
-// TaskManager
-//
-// Created by Ravi Shankar on 12/07/14.
-// Copyright (c) 2014 Ravi Shankar. All rights reserved.
-//
-
-import UIKit
-import CoreData
-
-class TaskDetailViewController: UIViewController {
-
- let managedObjectContext = (UIApplication.sharedApplication().delegate as AppDelegate).managedObjectContext
-
- @IBOutlet var txtDesc: UITextField!
-
- var task: Tasks? = nil
-
- override func viewDidLoad() {
- super.viewDidLoad()
- if task != nil {
- txtDesc.text = (task as Tasks).desc
- }
- }
-
- @IBAction func done(sender: AnyObject) {
- if task != nil {
- editTask()
- } else {
- createTask()
- }
- dismissViewController()
- }
-
- @IBAction func cancel(sender: AnyObject) {
- dismissViewController()
- }
-
- func dismissViewController() {
- navigationController.popViewControllerAnimated(true)
- }
-
- func createTask() {
- let entityDescripition = NSEntityDescription.entityForName("Tasks", inManagedObjectContext: managedObjectContext)
- let task = Tasks(entity: entityDescripition, insertIntoManagedObjectContext: managedObjectContext)
- task.desc = txtDesc.text
- managedObjectContext.save(nil)
- }
-
- func editTask() {
- (task as Tasks).desc = txtDesc.text
- managedObjectContext.save(nil)
- }
-
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
-
-
-}
diff --git a/TaskManagerViewController.swift b/TaskManagerViewController.swift
deleted file mode 100755
index 715ff32..0000000
--- a/TaskManagerViewController.swift
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// TaskManagerViewController.swift
-// TaskManager
-//
-// Created by Ravi Shankar on 12/07/14.
-// Copyright (c) 2014 Ravi Shankar. All rights reserved.
-//
-
-import UIKit
-import CoreData
-
-class TaskManagerViewController: UITableViewController, NSFetchedResultsControllerDelegate {
-
- let managedObjectContext = (UIApplication.sharedApplication().delegate as AppDelegate).managedObjectContext
-
- var fetchedResultController: NSFetchedResultsController = NSFetchedResultsController()
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- fetchedResultController = getFetchedResultController()
- fetchedResultController.delegate = self
- fetchedResultController.performFetch(nil)
- }
-
- override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
- if segue.identifier == "edit" {
- let cell = sender as UITableViewCell
- let indexPath = tableView.indexPathForCell(cell)
- let taskController:TaskDetailViewController = segue.destinationViewController as TaskDetailViewController
- let task:Tasks = fetchedResultController.objectAtIndexPath(indexPath) as Tasks
- taskController.task = task
- }
- }
-
-
- func getFetchedResultController() -> NSFetchedResultsController {
- fetchedResultController = NSFetchedResultsController(fetchRequest: taskFetchRequest(), managedObjectContext: managedObjectContext, sectionNameKeyPath: nil, cacheName: nil)
- return fetchedResultController
- }
-
- func taskFetchRequest() -> NSFetchRequest {
- let fetchRequest = NSFetchRequest(entityName: "Tasks")
- let sortDescriptor = NSSortDescriptor(key: "desc", ascending: true)
- fetchRequest.sortDescriptors = [sortDescriptor]
- return fetchRequest
- }
-
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
-
- // #pragma mark - Table view data source
-
- override func numberOfSectionsInTableView(tableView: UITableView!) -> Int {
- return fetchedResultController.sections.count
- }
-
- override func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
- return fetchedResultController.sections[section].numberOfObjects
- }
-
- override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell? {
- var cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
- let task = fetchedResultController.objectAtIndexPath(indexPath) as Tasks
- cell.textLabel.text = task.desc
- return cell
- }
-
- override func tableView(tableView: UITableView!, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath!) {
- let managedObject:NSManagedObject = fetchedResultController.objectAtIndexPath(indexPath) as NSManagedObject
- managedObjectContext.deleteObject(managedObject)
- managedObjectContext.save(nil)
- }
-
- func controllerDidChangeContent(controller: NSFetchedResultsController!) {
- tableView.reloadData()
- }
-}
diff --git a/Tasks.swift b/Tasks.swift
deleted file mode 100755
index 571c02a..0000000
--- a/Tasks.swift
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Tasks.swift
-// TaskManager
-//
-// Created by Ravi Shankar on 12/07/14.
-// Copyright (c) 2014 Ravi Shankar. All rights reserved.
-//
-
-import Foundation
-import CoreData
-
-class Tasks: NSManagedObject {
-
- @NSManaged var desc: String
-
-}
diff --git a/VCMain.swift b/VCMain.swift
deleted file mode 100755
index a4ad8c6..0000000
--- a/VCMain.swift
+++ /dev/null
@@ -1,393 +0,0 @@
-// VCMain.swift
-// swiftPeaceTrack<3
-//
-// Created by Shelagh McGowan on 7/4/14.
-// Copyright (c) 2014 Shelagh McGowan. All rights reserved.
-// Citing https://github.com/GabrielMassana/Picker-iOS8 :Picker menu views code
-import Foundation
-import UIKit
-import CoreData
-class VCMain: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate, NSURLConnectionDelegate {
-
- //configure text boxes
- @IBOutlet var txtFullName: UITextField!
- @IBOutlet var txtVolunteerID: UITextField!
-
- @IBAction func showAlertButtonTapped(sender: AnyObject) {
- var myAlertView = UIAlertView()
-
- myAlertView.title = "iOScreator"
- myAlertView.message = "Hello, world!"
- myAlertView.addButtonWithTitle("Dismiss")
-
- myAlertView.show()
-
- }
-
- //configure picker views
- var countryPicker = UIPickerView()
- var sectorPicker = UIPickerView()
-
- var countryPickerData = NSArray()
- var sectorPickerData = NSArray()
-
- var countriesArray: NSMutableArray = NSMutableArray()
- var sectorsArray: NSMutableArray = NSMutableArray()
-
- //configure lables related to picker views
- @IBOutlet var countryLabel : UILabel = nil
- @IBOutlet var sectorLabel : UILabel = nil
-
- //get the window ready
- var actionView: UIView = UIView()
- var window: UIWindow? = nil
-
- //gets everything set up in the view
- override func viewDidLoad() {
- super.viewDidLoad()
- var delegate = UIApplication.sharedApplication()
- var myWindow: UIWindow? = delegate.keyWindow
- var myWindow2: NSArray = delegate.windows
-
- if let myWindow: UIWindow = UIApplication.sharedApplication().keyWindow
- {
- window = myWindow
- }
- else {
- window = myWindow2[0] as? UIWindow
- }
-
- countryPicker.backgroundColor = UIColor.whiteColor()
- sectorPicker.backgroundColor = UIColor.whiteColor()
-
- actionView.frame = CGRectMake(0, UIScreen.mainScreen().bounds.size.height.0, UIScreen.mainScreen().bounds.size.width, 260.0)
-
- var filePath = NSBundle.mainBundle().pathForResource("Property List", ofType: "plist")
- var filePath2 = NSBundle.mainBundle().pathForResource("sectors", ofType: "plist")
- countriesArray = NSMutableArray(contentsOfFile: filePath)
- countriesArray.insertObject("", atIndex: 0)
- countriesArray.insertObject("No country", atIndex: 0)
- countriesArray.insertObject("pickel", atIndex: 1)
- sectorsArray = NSMutableArray(contentsOfFile: filePath2)
- sectorsArray.insertObject("", atIndex: 0)
- sectorsArray.insertObject("No sector", atIndex: 0)
-
- }
-
- //API code
- /* override func viewWillAppear(animated: Bool) {
- super.viewWillAppear(animated)
- startConnection()
- }*/
-
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
-
- //creates a new user object and saves it to the database. also prints out the object for you to see.
- @IBAction func btnLoginAndSave(){
-
- //create a new variable appDel to store app delegate
- //cast delegate of type UIApplication to our delegate type AppDelegate
- var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate)
- //get our ManagedObjectContext from our app delegate. now we are able to save and load information from our SQLite file.
- var context:NSManagedObjectContext = appDel.managedObjectContext
- //make a new user object that will be inserting itself into the database
- //cast it back to an NSManagedObject
- var newUser = NSEntityDescription.insertNewObjectForEntityForName("Users", inManagedObjectContext: context) as NSManagedObject
-
- newUser.setValue(""+txtFullName.text, forKey: "username")
- newUser.setValue(""+txtVolunteerID.text, forKey: "password")
- newUser.setValue(""+countryLabel.text, forKey:"post")
- newUser.setValue(""+sectorLabel.text, forKey:"sector")
-
- // if email !valid , then (print to console) create and diplay alert view
- // if any value above is nil, then (print to console) create and display alert view
-
- //else
- //save the object
- context.save(nil)
- //placeholder to show an error message
- //print object to the console
- println(newUser)
- println("Object Saved")
- //test case
- //println("save button pressed \(txtFullName.text)")
- //initiate segue to home screen.
- }
-
- /* func shouldPerformSegueWithIdentifier(_ identifier: String!,
- sender sender: AnyObject!) -> Bool
- */
-
- //just a test to see loading of all user objects in database in the console
- @IBAction func btnLoadTest(){
-
- //same as btnSave() function
- var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate)
- //same as btnSave() function
- var context:NSManagedObjectContext = appDel.managedObjectContext
- //asking database to perform a request on the user's table
- var request = NSFetchRequest(entityName: "Users")
- //fixes a bug (optional) objects were always coming back as false.
- request.returnsObjectsAsFaults = false;
- //ask the context to execute a fetch request. errors will be handled here.
- var results:NSArray = context.executeFetchRequest(request, error: nil)
- //if there are results, loop through them and print them to the console
- if(results.count > 0){
- for res in results{
- println(res)
- }
- }else{
- println("0 Results Returned...Potential Error")
- }
- //test case
- //println("load button pressed \(txtVolunteerID.text)")
-
- }
-
-
- @IBAction func openCountryPicker(sender : UIButton)
- {
- let kSCREEN_WIDTH = UIScreen.mainScreen().bounds.size.width
-
- countryPicker.frame = CGRectMake(0.0, 44.0,kSCREEN_WIDTH, 216.0)
- countryPicker.dataSource = self
- countryPicker.delegate = self
- countryPicker.showsSelectionIndicator = true;
- countryPicker.backgroundColor = UIColor.whiteColor()
-
- var pickerDateToolbar = UIToolbar(frame: CGRectMake(0, 0, 320, 44))
- pickerDateToolbar.barStyle = UIBarStyle.Black
- pickerDateToolbar.barTintColor = UIColor.grayColor()
- pickerDateToolbar.translucent = true
-
- var barItems = NSMutableArray()
-
- var labelCancel = UILabel()
- labelCancel.text = "Cancel"
- var titleCancel = UIBarButtonItem(title: labelCancel.text, style: UIBarButtonItemStyle.Plain, target: self, action: Selector("cancelPickerSelectionButtonClicked:"))
- barItems.addObject(titleCancel)
-
- var flexSpace: UIBarButtonItem
- flexSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: self, action: nil)
- barItems.addObject(flexSpace)
-
- countryPickerData = countriesArray
- countryPicker.selectRow(1, inComponent: 0, animated: false)
-
- let doneBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Done, target: self, action: Selector("countryDoneClicked:"))
- barItems.addObject(doneBtn)
-
- pickerDateToolbar.setItems(barItems, animated: true)
-
- actionView.addSubview(pickerDateToolbar)
- actionView.addSubview(countryPicker)
-
- if window {
- window!.addSubview(actionView)
- }
- else
- {
- self.view.addSubview(actionView)
- }
-
- UIView.animateWithDuration(0.2, animations: {
-
- self.actionView.frame = CGRectMake(0, UIScreen.mainScreen().bounds.size.height - 260.0, UIScreen.mainScreen().bounds.size.width, 260.0)
-
- })
- }
-
- @IBAction func openSectorPicker(sender : UIButton)
- {
- let kSCREEN_WIDTH = UIScreen.mainScreen().bounds.size.width
-
- sectorPicker.frame = CGRectMake(0.0, 44.0,kSCREEN_WIDTH, 216.0)
- sectorPicker.dataSource = self
- sectorPicker.delegate = self
- sectorPicker.showsSelectionIndicator = true;
- sectorPicker.backgroundColor = UIColor.whiteColor()
-
- var pickerDateToolbar = UIToolbar(frame: CGRectMake(0, 0, 320, 44))
- pickerDateToolbar.barStyle = UIBarStyle.Black
- pickerDateToolbar.barTintColor = UIColor.grayColor()
- pickerDateToolbar.translucent = true
-
- var barItems = NSMutableArray()
-
- var labelCancel = UILabel()
- labelCancel.text = "Cancel"
- var titleCancel = UIBarButtonItem(title: labelCancel.text, style: UIBarButtonItemStyle.Plain, target: self, action: Selector("cancelPickerSelectionButtonClicked:"))
- barItems.addObject(titleCancel)
-
- var flexSpace: UIBarButtonItem
- flexSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: self, action: nil)
- barItems.addObject(flexSpace)
-
- sectorPickerData = sectorsArray
- sectorPicker.selectRow(1, inComponent: 0, animated: false)
-
- let doneBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Done, target: self, action: Selector("sectorDoneClicked:"))
- barItems.addObject(doneBtn)
-
- pickerDateToolbar.setItems(barItems, animated: true)
-
- actionView.addSubview(pickerDateToolbar)
- actionView.addSubview(sectorPicker)
-
- if window {
- window!.addSubview(actionView)
- }
- else
- {
- self.view.addSubview(actionView)
- }
-
- UIView.animateWithDuration(0.2, animations: {
-
- self.actionView.frame = CGRectMake(0, UIScreen.mainScreen().bounds.size.height - 260.0, UIScreen.mainScreen().bounds.size.width, 260.0)
-
- })
- }
-
- func cancelPickerSelectionButtonClicked(sender: UIBarButtonItem) {
-
- UIView.animateWithDuration(0.2, animations: {
-
- self.actionView.frame = CGRectMake(0, UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width, 260.0)
-
- }, completion: { _ in
- for obj: AnyObject in self.actionView.subviews {
- if let view = obj as? UIView
- {
- view.removeFromSuperview()
- }
- }
- })
- }
-
- func countryDoneClicked(sender: UIBarButtonItem) {
-
-
- var myRow = countryPicker.selectedRowInComponent(0)
- countryLabel.text = countryPickerData.objectAtIndex(myRow) as NSString
-
- if countryLabel.text == "" {
- countryLabel.text = "No country"
- }
-
- UIView.animateWithDuration(0.2, animations: {
-
- self.actionView.frame = CGRectMake(0, UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width, 260.0)
-
- }, completion: { _ in
- for obj: AnyObject in self.actionView.subviews {
- if let view = obj as? UIView
- {
- view.removeFromSuperview()
- }
- }
- })
- }
-
- func sectorDoneClicked(sender: UIBarButtonItem) {
-
-
- var myRow = sectorPicker.selectedRowInComponent(0)
- sectorLabel.text = sectorPickerData.objectAtIndex(myRow) as NSString
-
- if sectorLabel.text == "" {
- sectorLabel.text = "No country"
- }
-
- UIView.animateWithDuration(0.2, animations: {
-
- self.actionView.frame = CGRectMake(0, UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width, 260.0)
-
- }, completion: { _ in
- for obj: AnyObject in self.actionView.subviews {
- if let view = obj as? UIView
- {
- view.removeFromSuperview()
- }
- }
- })
- }
-
- // MARK - Picker delegate
-
- func pickerView(_pickerView: UIPickerView!, numberOfRowsInComponent component: Int) -> Int {
-
- var placeholder = 0
-
- if(countryPickerData == countriesArray){
- placeholder=countryPickerData.count
- }
- else{
- placeholder=sectorPickerData.count
- }
- return placeholder
- }
-
-
-
- func numberOfComponentsInPickerView(_pickerView: UIPickerView!) -> Int {
- return 1
- }
-
- //why is this coming up as a "?"
- func PickerView(_pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String! {
- var pl: NSString
- if(countryPickerData == countriesArray){
- pl=countryPickerData.objectAtIndex(row) as NSString
- }
- else{
- pl=sectorPickerData.objectAtIndex(row) as NSString
- }
- return pl
- }
-
-
- /****API connection code
-
- @lazy var data = NSMutableData()
-
-
- func startConnection(){
- let urlPath: String = "http://lacedwithperfectsmiles.tumblr.com"
- var url: NSURL = NSURL(string: urlPath)
- var request: NSURLRequest = NSURLRequest(URL: url)
- var connection: NSURLConnection = NSURLConnection(request: request, delegate: self, startImmediately: false)
- connection.start()
- }
-
- func connection(connection: NSURLConnection!, didReceiveData data: NSData!){
- self.data.appendData(data)
- }
-
- func buttonAction(sender: UIButton!){
- startConnection()
- }
-
- func connectionDidFinishLoading(connection: NSURLConnection!) {
- var err: NSError
- // throwing an error on the line below (can't figure out where the error message is)
- var jsonResult: NSDictionary = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: nil) as NSDictionary
- println(jsonResult)
- }
-
- func getJSON(urlToRequest: String) -> NSData{
- return NSData(contentsOfURL: NSURL(string: urlToRequest))
- }
-
- func parseJSON(inputData: NSData) -> NSDictionary{
- var error: NSError?
- var boardsDictionary: NSDictionary = NSJSONSerialization.JSONObjectWithData(inputData, options: NSJSONReadingOptions.MutableContainers, error: &error) as NSDictionary
-
- return boardsDictionary
- }
-}*****/
-
-}
\ No newline at end of file
diff --git a/sectors.plist b/sectors.plist
deleted file mode 100755
index 8a0e261..0000000
--- a/sectors.plist
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- Education
- Community Economic Development
- Rural Family Health Project
- TEFL PROJECT
- Environmental Action and Food Security (EAFS)
-
-
diff --git a/swiftPeaceTrack<3-Bridging-Header.h b/swiftPeaceTrack<3-Bridging-Header.h
deleted file mode 100644
index 1b2cb5d..0000000
--- a/swiftPeaceTrack<3-Bridging-Header.h
+++ /dev/null
@@ -1,4 +0,0 @@
-//
-// Use this file to import your target's public headers that you would like to expose to Swift.
-//
-
diff --git a/swiftPeaceTrack<3.xcodeproj/project.pbxproj b/swiftPeaceTrack<3.xcodeproj/project.pbxproj
deleted file mode 100755
index ddcd25a..0000000
--- a/swiftPeaceTrack<3.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,461 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 213B59FA1982E21900D6D314 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 213B59F91982E21900D6D314 /* Main.storyboard */; };
- 213B59FB1982E21900D6D314 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 213B59F91982E21900D6D314 /* Main.storyboard */; };
- 215711E219673D0D009A533C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 215711E119673D0D009A533C /* AppDelegate.swift */; };
- 215711E519673D0D009A533C /* swiftPeaceTrack_3.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 215711E319673D0D009A533C /* swiftPeaceTrack_3.xcdatamodeld */; };
- 215711E719673D0E009A533C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 215711E619673D0D009A533C /* Images.xcassets */; };
- 215711F319673D0E009A533C /* swiftPeaceTrack_3Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 215711F219673D0E009A533C /* swiftPeaceTrack_3Tests.swift */; };
- 215711FF19673E8D009A533C /* VCMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 215711FE19673E8D009A533C /* VCMain.swift */; };
- 21763DCB197F12D4007BC9D0 /* Property List.plist in Resources */ = {isa = PBXBuildFile; fileRef = 21763DCA197F12D3007BC9D0 /* Property List.plist */; };
- 21763DCD197F134F007BC9D0 /* sectors.plist in Resources */ = {isa = PBXBuildFile; fileRef = 21763DCC197F134F007BC9D0 /* sectors.plist */; };
- 21CFD9C0198AE1AA00DCECE4 /* TaskManagerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21CFD9BF198AE1AA00DCECE4 /* TaskManagerViewController.swift */; };
- 21CFD9C2198AE1B900DCECE4 /* TaskDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21CFD9C1198AE1B900DCECE4 /* TaskDetailViewController.swift */; };
- 21DE4EE7198AF27F004F1AC5 /* Tasks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21DE4EE6198AF27F004F1AC5 /* Tasks.swift */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 215711ED19673D0E009A533C /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 215711D419673D0D009A533C /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 215711DB19673D0D009A533C;
- remoteInfo = "swiftPeaceTrack<3";
- };
- 21BD58BE198AE98F00D4AE02 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 215711D419673D0D009A533C /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 215711DB19673D0D009A533C;
- remoteInfo = "swiftPeaceTrack<3";
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 213B59F91982E21900D6D314 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; };
- 215711DC19673D0D009A533C /* swiftPeaceTrack<3.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "swiftPeaceTrack<3.app"; sourceTree = BUILT_PRODUCTS_DIR; };
- 215711E019673D0D009A533C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 215711E119673D0D009A533C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
- 215711E419673D0D009A533C /* swiftPeaceTrack_3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = swiftPeaceTrack_3.xcdatamodel; sourceTree = ""; };
- 215711E619673D0D009A533C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
- 215711EC19673D0E009A533C /* swiftPeaceTrack<3Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "swiftPeaceTrack<3Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
- 215711F119673D0E009A533C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 215711F219673D0E009A533C /* swiftPeaceTrack_3Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = swiftPeaceTrack_3Tests.swift; sourceTree = ""; };
- 215711FE19673E8D009A533C /* VCMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCMain.swift; sourceTree = ""; };
- 21763DCA197F12D3007BC9D0 /* Property List.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Property List.plist"; sourceTree = ""; };
- 21763DCC197F134F007BC9D0 /* sectors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = sectors.plist; sourceTree = ""; };
- 21CFD9BF198AE1AA00DCECE4 /* TaskManagerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskManagerViewController.swift; sourceTree = ""; };
- 21CFD9C1198AE1B900DCECE4 /* TaskDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskDetailViewController.swift; sourceTree = ""; };
- 21DE4EE2198AF202004F1AC5 /* swiftPeaceTrack<3-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "swiftPeaceTrack<3-Bridging-Header.h"; sourceTree = ""; };
- 21DE4EE6198AF27F004F1AC5 /* Tasks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tasks.swift; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 215711D919673D0D009A533C /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 215711E919673D0E009A533C /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 215711D319673D0D009A533C = {
- isa = PBXGroup;
- children = (
- 215711DE19673D0D009A533C /* swiftPeaceTrack<3 */,
- 215711EF19673D0E009A533C /* swiftPeaceTrack<3Tests */,
- 215711DD19673D0D009A533C /* Products */,
- );
- sourceTree = "";
- };
- 215711DD19673D0D009A533C /* Products */ = {
- isa = PBXGroup;
- children = (
- 215711DC19673D0D009A533C /* swiftPeaceTrack<3.app */,
- 215711EC19673D0E009A533C /* swiftPeaceTrack<3Tests.xctest */,
- );
- name = Products;
- sourceTree = "";
- };
- 215711DE19673D0D009A533C /* swiftPeaceTrack<3 */ = {
- isa = PBXGroup;
- children = (
- 21DE4EE6198AF27F004F1AC5 /* Tasks.swift */,
- 21CFD9C1198AE1B900DCECE4 /* TaskDetailViewController.swift */,
- 21CFD9BF198AE1AA00DCECE4 /* TaskManagerViewController.swift */,
- 213B59F91982E21900D6D314 /* Main.storyboard */,
- 215711E119673D0D009A533C /* AppDelegate.swift */,
- 215711E619673D0D009A533C /* Images.xcassets */,
- 215711E319673D0D009A533C /* swiftPeaceTrack_3.xcdatamodeld */,
- 215711DF19673D0D009A533C /* Supporting Files */,
- 215711FE19673E8D009A533C /* VCMain.swift */,
- 21763DCA197F12D3007BC9D0 /* Property List.plist */,
- 21763DCC197F134F007BC9D0 /* sectors.plist */,
- 21DE4EE2198AF202004F1AC5 /* swiftPeaceTrack<3-Bridging-Header.h */,
- );
- path = "swiftPeaceTrack<3";
- sourceTree = "";
- };
- 215711DF19673D0D009A533C /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- 215711E019673D0D009A533C /* Info.plist */,
- );
- name = "Supporting Files";
- sourceTree = "";
- };
- 215711EF19673D0E009A533C /* swiftPeaceTrack<3Tests */ = {
- isa = PBXGroup;
- children = (
- 215711F219673D0E009A533C /* swiftPeaceTrack_3Tests.swift */,
- 215711F019673D0E009A533C /* Supporting Files */,
- );
- path = "swiftPeaceTrack<3Tests";
- sourceTree = "";
- };
- 215711F019673D0E009A533C /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- 215711F119673D0E009A533C /* Info.plist */,
- );
- name = "Supporting Files";
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 215711DB19673D0D009A533C /* swiftPeaceTrack<3 */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 215711F619673D0E009A533C /* Build configuration list for PBXNativeTarget "swiftPeaceTrack<3" */;
- buildPhases = (
- 215711D819673D0D009A533C /* Sources */,
- 215711D919673D0D009A533C /* Frameworks */,
- 215711DA19673D0D009A533C /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "swiftPeaceTrack<3";
- productName = "swiftPeaceTrack<3";
- productReference = 215711DC19673D0D009A533C /* swiftPeaceTrack<3.app */;
- productType = "com.apple.product-type.application";
- };
- 215711EB19673D0E009A533C /* swiftPeaceTrack<3Tests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 215711F919673D0E009A533C /* Build configuration list for PBXNativeTarget "swiftPeaceTrack<3Tests" */;
- buildPhases = (
- 215711E819673D0E009A533C /* Sources */,
- 215711E919673D0E009A533C /* Frameworks */,
- 215711EA19673D0E009A533C /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- 215711EE19673D0E009A533C /* PBXTargetDependency */,
- 21BD58BF198AE98F00D4AE02 /* PBXTargetDependency */,
- );
- name = "swiftPeaceTrack<3Tests";
- productName = "swiftPeaceTrack<3Tests";
- productReference = 215711EC19673D0E009A533C /* swiftPeaceTrack<3Tests.xctest */;
- productType = "com.apple.product-type.bundle.unit-test";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 215711D419673D0D009A533C /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0600;
- ORGANIZATIONNAME = "Shelagh McGowan";
- TargetAttributes = {
- 215711DB19673D0D009A533C = {
- CreatedOnToolsVersion = 6.0;
- };
- 215711EB19673D0E009A533C = {
- CreatedOnToolsVersion = 6.0;
- TestTargetID = 215711DB19673D0D009A533C;
- };
- };
- };
- buildConfigurationList = 215711D719673D0D009A533C /* Build configuration list for PBXProject "swiftPeaceTrack<3" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 215711D319673D0D009A533C;
- productRefGroup = 215711DD19673D0D009A533C /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 215711DB19673D0D009A533C /* swiftPeaceTrack<3 */,
- 215711EB19673D0E009A533C /* swiftPeaceTrack<3Tests */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 215711DA19673D0D009A533C /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 21763DCB197F12D4007BC9D0 /* Property List.plist in Resources */,
- 215711E719673D0E009A533C /* Images.xcassets in Resources */,
- 21763DCD197F134F007BC9D0 /* sectors.plist in Resources */,
- 213B59FA1982E21900D6D314 /* Main.storyboard in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 215711EA19673D0E009A533C /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 213B59FB1982E21900D6D314 /* Main.storyboard in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 215711D819673D0D009A533C /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 215711E519673D0D009A533C /* swiftPeaceTrack_3.xcdatamodeld in Sources */,
- 215711E219673D0D009A533C /* AppDelegate.swift in Sources */,
- 215711FF19673E8D009A533C /* VCMain.swift in Sources */,
- 21CFD9C0198AE1AA00DCECE4 /* TaskManagerViewController.swift in Sources */,
- 21DE4EE7198AF27F004F1AC5 /* Tasks.swift in Sources */,
- 21CFD9C2198AE1B900DCECE4 /* TaskDetailViewController.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 215711E819673D0E009A533C /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 215711F319673D0E009A533C /* swiftPeaceTrack_3Tests.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 215711EE19673D0E009A533C /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 215711DB19673D0D009A533C /* swiftPeaceTrack<3 */;
- targetProxy = 215711ED19673D0E009A533C /* PBXContainerItemProxy */;
- };
- 21BD58BF198AE98F00D4AE02 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 215711DB19673D0D009A533C /* swiftPeaceTrack<3 */;
- targetProxy = 21BD58BE198AE98F00D4AE02 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 215711F419673D0E009A533C /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- METAL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- };
- name = Debug;
- };
- 215711F519673D0E009A533C /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = YES;
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- METAL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = iphoneos;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 215711F719673D0E009A533C /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
- CLANG_ENABLE_MODULES = YES;
- INFOPLIST_FILE = "swiftPeaceTrack<3/Info.plist";
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "swiftPeaceTrack<3/swiftPeaceTrack<3-Bridging-Header.h";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- };
- name = Debug;
- };
- 215711F819673D0E009A533C /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
- CLANG_ENABLE_MODULES = YES;
- INFOPLIST_FILE = "swiftPeaceTrack<3/Info.plist";
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "swiftPeaceTrack<3/swiftPeaceTrack<3-Bridging-Header.h";
- };
- name = Release;
- };
- 215711FA19673D0E009A533C /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/swiftPeaceTrack<3.app/swiftPeaceTrack<3";
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- INFOPLIST_FILE = "swiftPeaceTrack<3Tests/Info.plist";
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- METAL_ENABLE_DEBUG_INFO = YES;
- PRODUCT_NAME = "$(TARGET_NAME)";
- TEST_HOST = "$(BUNDLE_LOADER)";
- };
- name = Debug;
- };
- 215711FB19673D0E009A533C /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/swiftPeaceTrack<3.app/swiftPeaceTrack<3";
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
- INFOPLIST_FILE = "swiftPeaceTrack<3Tests/Info.plist";
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- METAL_ENABLE_DEBUG_INFO = NO;
- PRODUCT_NAME = "$(TARGET_NAME)";
- TEST_HOST = "$(BUNDLE_LOADER)";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 215711D719673D0D009A533C /* Build configuration list for PBXProject "swiftPeaceTrack<3" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 215711F419673D0E009A533C /* Debug */,
- 215711F519673D0E009A533C /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 215711F619673D0E009A533C /* Build configuration list for PBXNativeTarget "swiftPeaceTrack<3" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 215711F719673D0E009A533C /* Debug */,
- 215711F819673D0E009A533C /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 215711F919673D0E009A533C /* Build configuration list for PBXNativeTarget "swiftPeaceTrack<3Tests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 215711FA19673D0E009A533C /* Debug */,
- 215711FB19673D0E009A533C /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
-
-/* Begin XCVersionGroup section */
- 215711E319673D0D009A533C /* swiftPeaceTrack_3.xcdatamodeld */ = {
- isa = XCVersionGroup;
- children = (
- 215711E419673D0D009A533C /* swiftPeaceTrack_3.xcdatamodel */,
- );
- currentVersion = 215711E419673D0D009A533C /* swiftPeaceTrack_3.xcdatamodel */;
- path = swiftPeaceTrack_3.xcdatamodeld;
- sourceTree = "";
- versionGroupType = wrapper.xcdatamodel;
- };
-/* End XCVersionGroup section */
- };
- rootObject = 215711D419673D0D009A533C /* Project object */;
-}
diff --git a/swiftPeaceTrack<3.xcodeproj/project.xcworkspace/xcuserdata/shelaghmcgowan.xcuserdatad/WorkspaceSettings.xcsettings b/swiftPeaceTrack<3.xcodeproj/project.xcworkspace/xcuserdata/shelaghmcgowan.xcuserdatad/WorkspaceSettings.xcsettings
deleted file mode 100644
index 1d588ff..0000000
--- a/swiftPeaceTrack<3.xcodeproj/project.xcworkspace/xcuserdata/shelaghmcgowan.xcuserdatad/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- BuildLocationStyle
- UseAppPreferences
- CustomBuildLocationType
- RelativeToDerivedData
- DerivedDataLocationStyle
- Default
- IssueFilterStyle
- ShowActiveSchemeOnly
- LiveSourceIssuesEnabled
-
- SnapshotAutomaticallyBeforeSignificantChanges
-
- SnapshotLocationStyle
- Default
-
-
diff --git a/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted file mode 100644
index 5325a11..0000000
--- a/swiftPeaceTrack<3.xcodeproj/xcuserdata/shelaghmcgowan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/swiftPeaceTrack_3.xcdatamodeld/.xccurrentversion b/swiftPeaceTrack_3.xcdatamodeld/.xccurrentversion
deleted file mode 100755
index eb792de..0000000
--- a/swiftPeaceTrack_3.xcdatamodeld/.xccurrentversion
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- _XCCurrentVersionName
- swiftPeaceTrack_3.xcdatamodel
-
-
diff --git a/swiftPeaceTrack_3.xcdatamodeld/swiftPeaceTrack_3.xcdatamodel/contents b/swiftPeaceTrack_3.xcdatamodeld/swiftPeaceTrack_3.xcdatamodel/contents
deleted file mode 100644
index 0e598c1..0000000
--- a/swiftPeaceTrack_3.xcdatamodeld/swiftPeaceTrack_3.xcdatamodel/contents
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file