├── SleepAnalysisStarter.zip ├── SleepAnalysis.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── simon.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── AnushkMittal.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ ├── simon.xcuserdatad │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── SleepAnalysis.xcscheme │ └── AnushkMittal.xcuserdatad │ │ ├── xcschemes │ │ ├── xcschememanagement.plist │ │ └── SleepAnalysis.xcscheme │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── project.pbxproj ├── SleepAnalysis ├── SleepAnalysis.entitlements ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── AppDelegate.swift └── ViewController.swift └── README.md /SleepAnalysisStarter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appcoda/SleepAnalysis/HEAD/SleepAnalysisStarter.zip -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/project.xcworkspace/xcuserdata/simon.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appcoda/SleepAnalysis/HEAD/SleepAnalysis.xcodeproj/project.xcworkspace/xcuserdata/simon.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/project.xcworkspace/xcuserdata/AnushkMittal.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appcoda/SleepAnalysis/HEAD/SleepAnalysis.xcodeproj/project.xcworkspace/xcuserdata/AnushkMittal.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SleepAnalysis/SleepAnalysis.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.healthkit 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A quick demo of HealthKit for Sleep Analysis 2 | 3 | Apple provides a cool way to communicate with user’s personal health information in a secure manner and store the information securely through the built-in Health app. Not only can you use HealthKit to build a fitness app, the framework also allows you access sleep analysis data. 4 | 5 | In this tutorial, I will give you a quick introduction to the HealthKit framework, and demonstrate how you can build a simple app for sleep analysis. 6 | 7 | For details, please refer to this link: 8 | 9 | http://www.appcoda.com/sleep-analysis-healthkit 10 | -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/xcuserdata/simon.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SleepAnalysis.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 2B3AAAE81CDF95F900EAD56B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/xcuserdata/AnushkMittal.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SleepAnalysis.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 2B3AAAE81CDF95F900EAD56B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SleepAnalysis/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/xcuserdata/AnushkMittal.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SleepAnalysis/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | healthkit 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SleepAnalysis/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SleepAnalysis/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SleepAnalysis 4 | // 5 | // Created by Anushk Mittal on 5/8/16. 6 | // Copyright © 2016 Anushk Mittal. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/xcuserdata/simon.xcuserdatad/xcschemes/SleepAnalysis.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/xcuserdata/AnushkMittal.xcuserdatad/xcschemes/SleepAnalysis.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /SleepAnalysis/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 29 | 43 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /SleepAnalysis/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SleepAnalysis 4 | // 5 | // Created by Anushk Mittal on 5/8/16. 6 | // Copyright © 2016 Anushk Mittal. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import HealthKit 11 | 12 | 13 | class ViewController: UIViewController { 14 | 15 | @IBOutlet var displayTimeLabel: UILabel! 16 | 17 | var startTime = NSTimeInterval() 18 | var timer:NSTimer = NSTimer() 19 | let healthStore = HKHealthStore() 20 | var endTime: NSDate! 21 | var alarmTime: NSDate! 22 | 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | // Do any additional setup after loading the view, typically from a nib. 27 | 28 | let typestoRead = Set([ 29 | HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis)! 30 | ]) 31 | 32 | let typestoShare = Set([ 33 | HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis)! 34 | ]) 35 | 36 | self.healthStore.requestAuthorizationToShareTypes(typestoShare, readTypes: typestoRead) { (success, error) -> Void in 37 | if success == false { 38 | NSLog(" Display not allowed") 39 | } 40 | } 41 | } 42 | 43 | 44 | @IBAction func start(sender: AnyObject) { 45 | alarmTime = NSDate() 46 | if (!timer.valid) { 47 | let aSelector : Selector = #selector(ViewController.updateTime) 48 | timer = NSTimer.scheduledTimerWithTimeInterval(0.01, target: self, selector: aSelector, userInfo: nil, repeats: true) 49 | startTime = NSDate.timeIntervalSinceReferenceDate() 50 | } 51 | 52 | } 53 | 54 | 55 | @IBAction func stop(sender: AnyObject) { 56 | endTime = NSDate() 57 | self.saveSleepAnalysis() 58 | self.retrieveSleepAnalysis() 59 | timer.invalidate() 60 | } 61 | 62 | func updateTime() { 63 | let currentTime = NSDate.timeIntervalSinceReferenceDate() 64 | 65 | //Find the difference between current time and start time. 66 | var elapsedTime: NSTimeInterval = currentTime - startTime 67 | 68 | // print(elapsedTime) 69 | // print(Int(elapsedTime)) 70 | 71 | //calculate the minutes in elapsed time. 72 | let minutes = UInt8(elapsedTime / 60.0) 73 | elapsedTime -= (NSTimeInterval(minutes) * 60) 74 | 75 | //calculate the seconds in elapsed time. 76 | let seconds = UInt8(elapsedTime) 77 | elapsedTime -= NSTimeInterval(seconds) 78 | 79 | //find out the fraction of milliseconds to be displayed. 80 | let fraction = UInt8(elapsedTime * 100) 81 | 82 | //add the leading zero for minutes, seconds and millseconds and store them as string constants 83 | 84 | let strMinutes = String(format: "%02d", minutes) 85 | let strSeconds = String(format: "%02d", seconds) 86 | let strFraction = String(format: "%02d", fraction) 87 | 88 | //concatenate minuets, seconds and milliseconds as assign it to the UILabel 89 | displayTimeLabel.text = "\(strMinutes):\(strSeconds):\(strFraction)" 90 | } 91 | 92 | 93 | func saveSleepAnalysis() { 94 | 95 | 96 | 97 | if let sleepType = HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis) { 98 | 99 | // we create new object we want to push in Health app 100 | 101 | let object = HKCategorySample(type:sleepType, value: HKCategoryValueSleepAnalysis.InBed.rawValue, startDate: self.alarmTime, endDate: self.endTime) 102 | 103 | // we now push the object to HealthStore 104 | 105 | healthStore.saveObject(object, withCompletion: { (success, error) -> Void in 106 | 107 | if error != nil { 108 | 109 | // handle the error in your app gracefully 110 | return 111 | 112 | } 113 | 114 | if success { 115 | print("My new data was saved in Healthkit") 116 | 117 | } else { 118 | // It was an error again 119 | 120 | } 121 | 122 | }) 123 | 124 | 125 | let object2 = HKCategorySample(type:sleepType, value: HKCategoryValueSleepAnalysis.Asleep.rawValue, startDate: self.alarmTime, endDate: self.endTime) 126 | 127 | 128 | healthStore.saveObject(object2, withCompletion: { (success, error) -> Void in 129 | 130 | if error != nil { 131 | 132 | // handle the error in your app gracefully 133 | return 134 | 135 | } 136 | 137 | if success { 138 | print("My new data (2) was saved in Healthkit") 139 | 140 | } else { 141 | // It was an error again 142 | 143 | } 144 | 145 | }) 146 | 147 | 148 | } 149 | 150 | } 151 | 152 | 153 | 154 | 155 | 156 | 157 | func retrieveSleepAnalysis() { 158 | 159 | // startDate and endDate are NSDate objects 160 | 161 | // ... 162 | 163 | // first, we define the object type we want 164 | 165 | if let sleepType = HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis) { 166 | 167 | // You may want to use a predicate to filter the data... startDate and endDate are NSDate objects corresponding to the time range that you want to retrieve 168 | 169 | //let predicate = HKQuery.predicateForSamplesWithStartDate(startDate,endDate: endDate ,options: .None) 170 | 171 | // Get the recent data first 172 | 173 | let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierEndDate, ascending: false) 174 | 175 | // the block completion to execute 176 | 177 | let query = HKSampleQuery(sampleType: sleepType, predicate: nil, limit: 30, sortDescriptors: [sortDescriptor]) { (query, tmpResult, error) -> Void in 178 | 179 | if error != nil { 180 | 181 | // Handle the error in your app gracefully 182 | return 183 | 184 | } 185 | 186 | if let result = tmpResult { 187 | 188 | for item in result { 189 | if let sample = item as? HKCategorySample { 190 | 191 | let value = (sample.value == HKCategoryValueSleepAnalysis.InBed.rawValue) ? "InBed" : "Asleep" 192 | 193 | print("Healthkit sleep: \(sample.startDate) \(sample.endDate) - value: \(value)") 194 | } 195 | } 196 | } 197 | } 198 | 199 | 200 | healthStore.executeQuery(query) 201 | } 202 | 203 | } 204 | 205 | 206 | override func didReceiveMemoryWarning() { 207 | super.didReceiveMemoryWarning() 208 | // Dispose of any resources that can be recreated. 209 | } 210 | 211 | 212 | } 213 | 214 | -------------------------------------------------------------------------------- /SleepAnalysis.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2B3AAAED1CDF95FA00EAD56B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B3AAAEC1CDF95FA00EAD56B /* AppDelegate.swift */; }; 11 | 2B3AAAEF1CDF95FA00EAD56B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B3AAAEE1CDF95FA00EAD56B /* ViewController.swift */; }; 12 | 2B3AAAF21CDF95FA00EAD56B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B3AAAF01CDF95FA00EAD56B /* Main.storyboard */; }; 13 | 2B3AAAF41CDF95FA00EAD56B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2B3AAAF31CDF95FA00EAD56B /* Assets.xcassets */; }; 14 | 2B3AAAF71CDF95FA00EAD56B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B3AAAF51CDF95FA00EAD56B /* LaunchScreen.storyboard */; }; 15 | 2B3AAB001CDF962100EAD56B /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B3AAAFF1CDF962100EAD56B /* HealthKit.framework */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 2B3AAAE91CDF95F900EAD56B /* SleepAnalysis.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SleepAnalysis.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 2B3AAAEC1CDF95FA00EAD56B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 2B3AAAEE1CDF95FA00EAD56B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | 2B3AAAF11CDF95FA00EAD56B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 2B3AAAF31CDF95FA00EAD56B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 2B3AAAF61CDF95FA00EAD56B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | 2B3AAAF81CDF95FA00EAD56B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 2B3AAAFE1CDF962100EAD56B /* SleepAnalysis.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = SleepAnalysis.entitlements; sourceTree = ""; }; 27 | 2B3AAAFF1CDF962100EAD56B /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 28 | /* End PBXFileReference section */ 29 | 30 | /* Begin PBXFrameworksBuildPhase section */ 31 | 2B3AAAE61CDF95F900EAD56B /* Frameworks */ = { 32 | isa = PBXFrameworksBuildPhase; 33 | buildActionMask = 2147483647; 34 | files = ( 35 | 2B3AAB001CDF962100EAD56B /* HealthKit.framework in Frameworks */, 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 2B3AAAE01CDF95F900EAD56B = { 43 | isa = PBXGroup; 44 | children = ( 45 | 2B3AAAFF1CDF962100EAD56B /* HealthKit.framework */, 46 | 2B3AAAEB1CDF95FA00EAD56B /* SleepAnalysis */, 47 | 2B3AAAEA1CDF95F900EAD56B /* Products */, 48 | ); 49 | sourceTree = ""; 50 | }; 51 | 2B3AAAEA1CDF95F900EAD56B /* Products */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 2B3AAAE91CDF95F900EAD56B /* SleepAnalysis.app */, 55 | ); 56 | name = Products; 57 | sourceTree = ""; 58 | }; 59 | 2B3AAAEB1CDF95FA00EAD56B /* SleepAnalysis */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 2B3AAAFE1CDF962100EAD56B /* SleepAnalysis.entitlements */, 63 | 2B3AAAEC1CDF95FA00EAD56B /* AppDelegate.swift */, 64 | 2B3AAAEE1CDF95FA00EAD56B /* ViewController.swift */, 65 | 2B3AAAF01CDF95FA00EAD56B /* Main.storyboard */, 66 | 2B3AAAF31CDF95FA00EAD56B /* Assets.xcassets */, 67 | 2B3AAAF51CDF95FA00EAD56B /* LaunchScreen.storyboard */, 68 | 2B3AAAF81CDF95FA00EAD56B /* Info.plist */, 69 | ); 70 | path = SleepAnalysis; 71 | sourceTree = ""; 72 | }; 73 | /* End PBXGroup section */ 74 | 75 | /* Begin PBXNativeTarget section */ 76 | 2B3AAAE81CDF95F900EAD56B /* SleepAnalysis */ = { 77 | isa = PBXNativeTarget; 78 | buildConfigurationList = 2B3AAAFB1CDF95FA00EAD56B /* Build configuration list for PBXNativeTarget "SleepAnalysis" */; 79 | buildPhases = ( 80 | 2B3AAAE51CDF95F900EAD56B /* Sources */, 81 | 2B3AAAE61CDF95F900EAD56B /* Frameworks */, 82 | 2B3AAAE71CDF95F900EAD56B /* Resources */, 83 | ); 84 | buildRules = ( 85 | ); 86 | dependencies = ( 87 | ); 88 | name = SleepAnalysis; 89 | productName = SleepAnalysis; 90 | productReference = 2B3AAAE91CDF95F900EAD56B /* SleepAnalysis.app */; 91 | productType = "com.apple.product-type.application"; 92 | }; 93 | /* End PBXNativeTarget section */ 94 | 95 | /* Begin PBXProject section */ 96 | 2B3AAAE11CDF95F900EAD56B /* Project object */ = { 97 | isa = PBXProject; 98 | attributes = { 99 | LastSwiftUpdateCheck = 0730; 100 | LastUpgradeCheck = 0730; 101 | ORGANIZATIONNAME = "Anushk Mittal"; 102 | TargetAttributes = { 103 | 2B3AAAE81CDF95F900EAD56B = { 104 | CreatedOnToolsVersion = 7.3; 105 | SystemCapabilities = { 106 | com.apple.HealthKit = { 107 | enabled = 1; 108 | }; 109 | }; 110 | }; 111 | }; 112 | }; 113 | buildConfigurationList = 2B3AAAE41CDF95F900EAD56B /* Build configuration list for PBXProject "SleepAnalysis" */; 114 | compatibilityVersion = "Xcode 3.2"; 115 | developmentRegion = English; 116 | hasScannedForEncodings = 0; 117 | knownRegions = ( 118 | en, 119 | Base, 120 | ); 121 | mainGroup = 2B3AAAE01CDF95F900EAD56B; 122 | productRefGroup = 2B3AAAEA1CDF95F900EAD56B /* Products */; 123 | projectDirPath = ""; 124 | projectRoot = ""; 125 | targets = ( 126 | 2B3AAAE81CDF95F900EAD56B /* SleepAnalysis */, 127 | ); 128 | }; 129 | /* End PBXProject section */ 130 | 131 | /* Begin PBXResourcesBuildPhase section */ 132 | 2B3AAAE71CDF95F900EAD56B /* Resources */ = { 133 | isa = PBXResourcesBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | 2B3AAAF71CDF95FA00EAD56B /* LaunchScreen.storyboard in Resources */, 137 | 2B3AAAF41CDF95FA00EAD56B /* Assets.xcassets in Resources */, 138 | 2B3AAAF21CDF95FA00EAD56B /* Main.storyboard in Resources */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXResourcesBuildPhase section */ 143 | 144 | /* Begin PBXSourcesBuildPhase section */ 145 | 2B3AAAE51CDF95F900EAD56B /* Sources */ = { 146 | isa = PBXSourcesBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 2B3AAAEF1CDF95FA00EAD56B /* ViewController.swift in Sources */, 150 | 2B3AAAED1CDF95FA00EAD56B /* AppDelegate.swift in Sources */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXSourcesBuildPhase section */ 155 | 156 | /* Begin PBXVariantGroup section */ 157 | 2B3AAAF01CDF95FA00EAD56B /* Main.storyboard */ = { 158 | isa = PBXVariantGroup; 159 | children = ( 160 | 2B3AAAF11CDF95FA00EAD56B /* Base */, 161 | ); 162 | name = Main.storyboard; 163 | sourceTree = ""; 164 | }; 165 | 2B3AAAF51CDF95FA00EAD56B /* LaunchScreen.storyboard */ = { 166 | isa = PBXVariantGroup; 167 | children = ( 168 | 2B3AAAF61CDF95FA00EAD56B /* Base */, 169 | ); 170 | name = LaunchScreen.storyboard; 171 | sourceTree = ""; 172 | }; 173 | /* End PBXVariantGroup section */ 174 | 175 | /* Begin XCBuildConfiguration section */ 176 | 2B3AAAF91CDF95FA00EAD56B /* Debug */ = { 177 | isa = XCBuildConfiguration; 178 | buildSettings = { 179 | ALWAYS_SEARCH_USER_PATHS = NO; 180 | CLANG_ANALYZER_NONNULL = YES; 181 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 182 | CLANG_CXX_LIBRARY = "libc++"; 183 | CLANG_ENABLE_MODULES = YES; 184 | CLANG_ENABLE_OBJC_ARC = YES; 185 | CLANG_WARN_BOOL_CONVERSION = YES; 186 | CLANG_WARN_CONSTANT_CONVERSION = YES; 187 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 188 | CLANG_WARN_EMPTY_BODY = YES; 189 | CLANG_WARN_ENUM_CONVERSION = YES; 190 | CLANG_WARN_INT_CONVERSION = YES; 191 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 192 | CLANG_WARN_UNREACHABLE_CODE = YES; 193 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 194 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 195 | COPY_PHASE_STRIP = NO; 196 | DEBUG_INFORMATION_FORMAT = dwarf; 197 | ENABLE_STRICT_OBJC_MSGSEND = YES; 198 | ENABLE_TESTABILITY = YES; 199 | GCC_C_LANGUAGE_STANDARD = gnu99; 200 | GCC_DYNAMIC_NO_PIC = NO; 201 | GCC_NO_COMMON_BLOCKS = YES; 202 | GCC_OPTIMIZATION_LEVEL = 0; 203 | GCC_PREPROCESSOR_DEFINITIONS = ( 204 | "DEBUG=1", 205 | "$(inherited)", 206 | ); 207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 209 | GCC_WARN_UNDECLARED_SELECTOR = YES; 210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 211 | GCC_WARN_UNUSED_FUNCTION = YES; 212 | GCC_WARN_UNUSED_VARIABLE = YES; 213 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 214 | MTL_ENABLE_DEBUG_INFO = YES; 215 | ONLY_ACTIVE_ARCH = YES; 216 | SDKROOT = iphoneos; 217 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 218 | }; 219 | name = Debug; 220 | }; 221 | 2B3AAAFA1CDF95FA00EAD56B /* Release */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ALWAYS_SEARCH_USER_PATHS = NO; 225 | CLANG_ANALYZER_NONNULL = YES; 226 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 227 | CLANG_CXX_LIBRARY = "libc++"; 228 | CLANG_ENABLE_MODULES = YES; 229 | CLANG_ENABLE_OBJC_ARC = YES; 230 | CLANG_WARN_BOOL_CONVERSION = YES; 231 | CLANG_WARN_CONSTANT_CONVERSION = YES; 232 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 233 | CLANG_WARN_EMPTY_BODY = YES; 234 | CLANG_WARN_ENUM_CONVERSION = YES; 235 | CLANG_WARN_INT_CONVERSION = YES; 236 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 | CLANG_WARN_UNREACHABLE_CODE = YES; 238 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 239 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 240 | COPY_PHASE_STRIP = NO; 241 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 242 | ENABLE_NS_ASSERTIONS = NO; 243 | ENABLE_STRICT_OBJC_MSGSEND = YES; 244 | GCC_C_LANGUAGE_STANDARD = gnu99; 245 | GCC_NO_COMMON_BLOCKS = YES; 246 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 247 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 248 | GCC_WARN_UNDECLARED_SELECTOR = YES; 249 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 250 | GCC_WARN_UNUSED_FUNCTION = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 253 | MTL_ENABLE_DEBUG_INFO = NO; 254 | SDKROOT = iphoneos; 255 | VALIDATE_PRODUCT = YES; 256 | }; 257 | name = Release; 258 | }; 259 | 2B3AAAFC1CDF95FA00EAD56B /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 263 | CODE_SIGN_ENTITLEMENTS = SleepAnalysis/SleepAnalysis.entitlements; 264 | CODE_SIGN_IDENTITY = "iPhone Developer"; 265 | INFOPLIST_FILE = SleepAnalysis/Info.plist; 266 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 267 | PRODUCT_BUNDLE_IDENTIFIER = com.anushkmittal.SleepAnalysis; 268 | PRODUCT_NAME = "$(TARGET_NAME)"; 269 | }; 270 | name = Debug; 271 | }; 272 | 2B3AAAFD1CDF95FA00EAD56B /* Release */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 276 | CODE_SIGN_ENTITLEMENTS = SleepAnalysis/SleepAnalysis.entitlements; 277 | CODE_SIGN_IDENTITY = "iPhone Developer"; 278 | INFOPLIST_FILE = SleepAnalysis/Info.plist; 279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 280 | PRODUCT_BUNDLE_IDENTIFIER = com.anushkmittal.SleepAnalysis; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | }; 283 | name = Release; 284 | }; 285 | /* End XCBuildConfiguration section */ 286 | 287 | /* Begin XCConfigurationList section */ 288 | 2B3AAAE41CDF95F900EAD56B /* Build configuration list for PBXProject "SleepAnalysis" */ = { 289 | isa = XCConfigurationList; 290 | buildConfigurations = ( 291 | 2B3AAAF91CDF95FA00EAD56B /* Debug */, 292 | 2B3AAAFA1CDF95FA00EAD56B /* Release */, 293 | ); 294 | defaultConfigurationIsVisible = 0; 295 | defaultConfigurationName = Release; 296 | }; 297 | 2B3AAAFB1CDF95FA00EAD56B /* Build configuration list for PBXNativeTarget "SleepAnalysis" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | 2B3AAAFC1CDF95FA00EAD56B /* Debug */, 301 | 2B3AAAFD1CDF95FA00EAD56B /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | /* End XCConfigurationList section */ 307 | }; 308 | rootObject = 2B3AAAE11CDF95F900EAD56B /* Project object */; 309 | } 310 | --------------------------------------------------------------------------------