├── DemoAndTests ├── OneShotLocationDemoApp.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── OneShotLocationDemoApp │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── ViewController.swift │ ├── Info.plist │ ├── AppDelegate.swift │ └── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.xib └── OneShotLocationDemoAppTests │ ├── Info.plist │ └── OneShotLocationDemoAppTests.swift ├── .gitignore ├── LICENSE ├── README.md └── OneShotLocationManager.swift /DemoAndTests/OneShotLocationDemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp/Images.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 | } -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.underplot.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // OneShotLocationDemoApp 4 | // 5 | // Created by Marin Todorov on 9/19/14. 6 | // Copyright (c) 2014 Underplot ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | @IBOutlet var label: UILabel! 14 | 15 | var manager: OneShotLocationManager? 16 | 17 | override func viewDidAppear(animated: Bool) { 18 | super.viewDidAppear(animated) 19 | 20 | // 21 | // request the current location 22 | // 23 | manager = OneShotLocationManager() 24 | manager!.fetchWithCompletion {location, error in 25 | 26 | // fetch location or an error 27 | if let loc = location { 28 | self.label.text = loc.description 29 | } else if let err = error { 30 | self.label.text = err.localizedDescription 31 | } 32 | 33 | // destroy the object immediately to save memory 34 | self.manager = nil 35 | } 36 | 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Marin Todorov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoAppTests/OneShotLocationDemoAppTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OneShotLocationDemoAppTests.swift 3 | // OneShotLocationDemoAppTests 4 | // 5 | // Created by Marin Todorov on 9/19/14. 6 | // Copyright (c) 2014 Underplot ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class OneShotLocationDemoAppTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.underplot.$(PRODUCT_NAME:rfc1034identifier) 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 | NSLocationWhenInUseUsageDescription 30 | Give us permission to use your device's location 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // OneShotLocationDemoApp 4 | // 5 | // Created by Marin Todorov on 9/19/14. 6 | // Copyright (c) 2014 Underplot ltd. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OneShotLocationManager (Swift) 2 | ========= 3 | 4 | #### ver 0.1 5 | 6 | Contents of this readme 7 | 8 | * Intro 9 | * Code Example 10 | * Credit 11 | * License 12 | 13 | 14 | Intro 15 | ======== 16 | 17 | Since CLLocationManager doesn’t support block based APIs sometimes it’s very annoying to setup a delegate and implement all delegate methods if you just want to fetch the current location once and that’s it. 18 | 19 | OneShotLocationManager is a class that solves that problem in Swift. Whenever you need to fetch the current device location you just need to create an instance of OneShotLocationManager and call the method to fetch a location. It will request the necessary authorizations and return the current location. Very easy. It just works. 20 | 21 | Installation 22 | ======== 23 | _The infrastructure and best practices for distributing Swift libraries is currently being developed by the developer community during this beta period of the language and Xcode. In the meantime, you can simply download this repository as a ZIP file and drag the `OneShotLocationManager.swift` file into your Xcode project._ 24 | 25 | --- 26 | 27 | 28 | Code Example 29 | ======== 30 | 31 | #### How to get the current location 32 | 33 | Here's the simplest way to use OneShotLocationManager in Swift: 34 | 35 |
36 | //in your view controller
37 | var manager: OneShotLocationManager?
38 | 
39 | override func viewDidLoad() {
40 |   manager = OneShotLocationManager()
41 |   manager!.fetchWithCompletion {location, error in
42 | 
43 |     // fetch location or an error
44 |     if let loc = location {
45 |       println(location)
46 |     } else if let err = error {
47 |       println(err.localizedDescription)
48 |     }
49 |     self.manager = nil
50 |   }
51 | }
52 | 
53 | 54 | For a **complete example app** check out the included Xcode project in this repository. 55 | 56 | 57 | 58 | Credit 59 | ======== 60 | 61 | Author: **Marin Todorov** 62 | 63 | * [https://github.com/icanzilb](https://github.com/icanzilb) 64 | * [https://twitter.com/icanzilb](https://twitter.com/icanzilb) 65 | * [http://www.touch-code-magazine.com/about/](http://www.touch-code-magazine.com/about/) 66 | 67 | 68 | License 69 | ======== 70 | OneShotLocationManager is available under the MIT license. See the LICENSE file for more info. 71 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /OneShotLocationManager.swift: -------------------------------------------------------------------------------- 1 | // OneShotLocationManager - fetches the current device location once and invokes a completion closure 2 | // 3 | // Copyright (c) 2014 Marin Todorov, Underplot ltd. 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | 10 | import UIKit 11 | import CoreLocation 12 | 13 | //possible errors 14 | enum OneShotLocationManagerErrors: Int { 15 | case AuthorizationDenied 16 | case AuthorizationNotDetermined 17 | case InvalidLocation 18 | } 19 | 20 | class OneShotLocationManager: NSObject, CLLocationManagerDelegate { 21 | 22 | //location manager 23 | private var locationManager: CLLocationManager? 24 | 25 | //destroy the manager 26 | deinit { 27 | locationManager?.delegate = nil 28 | locationManager = nil 29 | } 30 | 31 | typealias LocationClosure = ((location: CLLocation?, error: NSError?)->()) 32 | private var didComplete: LocationClosure? 33 | 34 | //location manager returned, call didcomplete closure 35 | private func _didComplete(location: CLLocation?, error: NSError?) { 36 | locationManager?.stopUpdatingLocation() 37 | didComplete?(location: location, error: error) 38 | locationManager?.delegate = nil 39 | locationManager = nil 40 | } 41 | 42 | //location authorization status changed 43 | func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) { 44 | 45 | switch status { 46 | case .AuthorizedWhenInUse: 47 | self.locationManager!.startUpdatingLocation() 48 | case .Denied: 49 | _didComplete(nil, error: NSError(domain: self.classForCoder.description(), 50 | code: OneShotLocationManagerErrors.AuthorizationDenied.rawValue, 51 | userInfo: nil)) 52 | default: 53 | break 54 | } 55 | } 56 | 57 | internal func locationManager(manager: CLLocationManager, didFailWithError error: NSError) { 58 | _didComplete(nil, error: error) 59 | } 60 | 61 | internal func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { 62 | let location = locations[0] 63 | _didComplete(location, error: nil) 64 | } 65 | 66 | //ask for location permissions, fetch 1 location, and return 67 | func fetchWithCompletion(completion: LocationClosure) { 68 | //store the completion closure 69 | didComplete = completion 70 | 71 | //fire the location manager 72 | locationManager = CLLocationManager() 73 | locationManager!.delegate = self 74 | 75 | //check for description key and ask permissions 76 | if (NSBundle.mainBundle().objectForInfoDictionaryKey("NSLocationWhenInUseUsageDescription") != nil) { 77 | locationManager!.requestWhenInUseAuthorization() 78 | } else if (NSBundle.mainBundle().objectForInfoDictionaryKey("NSLocationAlwaysUsageDescription") != nil) { 79 | locationManager!.requestAlwaysAuthorization() 80 | } else { 81 | fatalError("To use location in iOS8 you need to define either NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in the app bundle's Info.plist file") 82 | } 83 | 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /DemoAndTests/OneShotLocationDemoApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9C57931619CCCD3E003F67DD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C57931519CCCD3E003F67DD /* AppDelegate.swift */; }; 11 | 9C57931819CCCD3E003F67DD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C57931719CCCD3E003F67DD /* ViewController.swift */; }; 12 | 9C57931B19CCCD3E003F67DD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C57931919CCCD3E003F67DD /* Main.storyboard */; }; 13 | 9C57931D19CCCD3E003F67DD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C57931C19CCCD3E003F67DD /* Images.xcassets */; }; 14 | 9C57932019CCCD3E003F67DD /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C57931E19CCCD3E003F67DD /* LaunchScreen.xib */; }; 15 | 9C57932C19CCCD3E003F67DD /* OneShotLocationDemoAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C57932B19CCCD3E003F67DD /* OneShotLocationDemoAppTests.swift */; }; 16 | 9C6D387C19CCDEE20090A745 /* OneShotLocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C6D387B19CCDEE20090A745 /* OneShotLocationManager.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 9C57932619CCCD3E003F67DD /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 9C57930819CCCD3E003F67DD /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 9C57930F19CCCD3E003F67DD; 25 | remoteInfo = OneShotLocationDemoApp; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 9C57931019CCCD3E003F67DD /* OneShotLocationDemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OneShotLocationDemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 9C57931419CCCD3E003F67DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 9C57931519CCCD3E003F67DD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33 | 9C57931719CCCD3E003F67DD /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 34 | 9C57931A19CCCD3E003F67DD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 35 | 9C57931C19CCCD3E003F67DD /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 36 | 9C57931F19CCCD3E003F67DD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 37 | 9C57932519CCCD3E003F67DD /* OneShotLocationDemoAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OneShotLocationDemoAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 9C57932A19CCCD3E003F67DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 9C57932B19CCCD3E003F67DD /* OneShotLocationDemoAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OneShotLocationDemoAppTests.swift; sourceTree = ""; }; 40 | 9C6D387B19CCDEE20090A745 /* OneShotLocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OneShotLocationManager.swift; path = ../OneShotLocationManager.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 9C57930D19CCCD3E003F67DD /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | 9C57932219CCCD3E003F67DD /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | 9C57930719CCCD3E003F67DD = { 62 | isa = PBXGroup; 63 | children = ( 64 | 9C6D387B19CCDEE20090A745 /* OneShotLocationManager.swift */, 65 | 9C57931219CCCD3E003F67DD /* OneShotLocationDemoApp */, 66 | 9C57932819CCCD3E003F67DD /* OneShotLocationDemoAppTests */, 67 | 9C57931119CCCD3E003F67DD /* Products */, 68 | ); 69 | sourceTree = ""; 70 | }; 71 | 9C57931119CCCD3E003F67DD /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 9C57931019CCCD3E003F67DD /* OneShotLocationDemoApp.app */, 75 | 9C57932519CCCD3E003F67DD /* OneShotLocationDemoAppTests.xctest */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | 9C57931219CCCD3E003F67DD /* OneShotLocationDemoApp */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 9C57931519CCCD3E003F67DD /* AppDelegate.swift */, 84 | 9C57931719CCCD3E003F67DD /* ViewController.swift */, 85 | 9C57931919CCCD3E003F67DD /* Main.storyboard */, 86 | 9C57931C19CCCD3E003F67DD /* Images.xcassets */, 87 | 9C57931E19CCCD3E003F67DD /* LaunchScreen.xib */, 88 | 9C57931319CCCD3E003F67DD /* Supporting Files */, 89 | ); 90 | path = OneShotLocationDemoApp; 91 | sourceTree = ""; 92 | }; 93 | 9C57931319CCCD3E003F67DD /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 9C57931419CCCD3E003F67DD /* Info.plist */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | 9C57932819CCCD3E003F67DD /* OneShotLocationDemoAppTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 9C57932B19CCCD3E003F67DD /* OneShotLocationDemoAppTests.swift */, 105 | 9C57932919CCCD3E003F67DD /* Supporting Files */, 106 | ); 107 | path = OneShotLocationDemoAppTests; 108 | sourceTree = ""; 109 | }; 110 | 9C57932919CCCD3E003F67DD /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 9C57932A19CCCD3E003F67DD /* Info.plist */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | 9C57930F19CCCD3E003F67DD /* OneShotLocationDemoApp */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = 9C57932F19CCCD3E003F67DD /* Build configuration list for PBXNativeTarget "OneShotLocationDemoApp" */; 124 | buildPhases = ( 125 | 9C57930C19CCCD3E003F67DD /* Sources */, 126 | 9C57930D19CCCD3E003F67DD /* Frameworks */, 127 | 9C57930E19CCCD3E003F67DD /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = OneShotLocationDemoApp; 134 | productName = OneShotLocationDemoApp; 135 | productReference = 9C57931019CCCD3E003F67DD /* OneShotLocationDemoApp.app */; 136 | productType = "com.apple.product-type.application"; 137 | }; 138 | 9C57932419CCCD3E003F67DD /* OneShotLocationDemoAppTests */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 9C57933219CCCD3E003F67DD /* Build configuration list for PBXNativeTarget "OneShotLocationDemoAppTests" */; 141 | buildPhases = ( 142 | 9C57932119CCCD3E003F67DD /* Sources */, 143 | 9C57932219CCCD3E003F67DD /* Frameworks */, 144 | 9C57932319CCCD3E003F67DD /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | 9C57932719CCCD3E003F67DD /* PBXTargetDependency */, 150 | ); 151 | name = OneShotLocationDemoAppTests; 152 | productName = OneShotLocationDemoAppTests; 153 | productReference = 9C57932519CCCD3E003F67DD /* OneShotLocationDemoAppTests.xctest */; 154 | productType = "com.apple.product-type.bundle.unit-test"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | 9C57930819CCCD3E003F67DD /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastUpgradeCheck = 0600; 163 | ORGANIZATIONNAME = "Underplot ltd."; 164 | TargetAttributes = { 165 | 9C57930F19CCCD3E003F67DD = { 166 | CreatedOnToolsVersion = 6.0.1; 167 | }; 168 | 9C57932419CCCD3E003F67DD = { 169 | CreatedOnToolsVersion = 6.0.1; 170 | TestTargetID = 9C57930F19CCCD3E003F67DD; 171 | }; 172 | }; 173 | }; 174 | buildConfigurationList = 9C57930B19CCCD3E003F67DD /* Build configuration list for PBXProject "OneShotLocationDemoApp" */; 175 | compatibilityVersion = "Xcode 3.2"; 176 | developmentRegion = English; 177 | hasScannedForEncodings = 0; 178 | knownRegions = ( 179 | en, 180 | Base, 181 | ); 182 | mainGroup = 9C57930719CCCD3E003F67DD; 183 | productRefGroup = 9C57931119CCCD3E003F67DD /* Products */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | 9C57930F19CCCD3E003F67DD /* OneShotLocationDemoApp */, 188 | 9C57932419CCCD3E003F67DD /* OneShotLocationDemoAppTests */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | 9C57930E19CCCD3E003F67DD /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | 9C57931B19CCCD3E003F67DD /* Main.storyboard in Resources */, 199 | 9C57932019CCCD3E003F67DD /* LaunchScreen.xib in Resources */, 200 | 9C57931D19CCCD3E003F67DD /* Images.xcassets in Resources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | 9C57932319CCCD3E003F67DD /* Resources */ = { 205 | isa = PBXResourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | /* End PBXResourcesBuildPhase section */ 212 | 213 | /* Begin PBXSourcesBuildPhase section */ 214 | 9C57930C19CCCD3E003F67DD /* Sources */ = { 215 | isa = PBXSourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | 9C57931819CCCD3E003F67DD /* ViewController.swift in Sources */, 219 | 9C6D387C19CCDEE20090A745 /* OneShotLocationManager.swift in Sources */, 220 | 9C57931619CCCD3E003F67DD /* AppDelegate.swift in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | 9C57932119CCCD3E003F67DD /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 9C57932C19CCCD3E003F67DD /* OneShotLocationDemoAppTests.swift in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXTargetDependency section */ 235 | 9C57932719CCCD3E003F67DD /* PBXTargetDependency */ = { 236 | isa = PBXTargetDependency; 237 | target = 9C57930F19CCCD3E003F67DD /* OneShotLocationDemoApp */; 238 | targetProxy = 9C57932619CCCD3E003F67DD /* PBXContainerItemProxy */; 239 | }; 240 | /* End PBXTargetDependency section */ 241 | 242 | /* Begin PBXVariantGroup section */ 243 | 9C57931919CCCD3E003F67DD /* Main.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | 9C57931A19CCCD3E003F67DD /* Base */, 247 | ); 248 | name = Main.storyboard; 249 | sourceTree = ""; 250 | }; 251 | 9C57931E19CCCD3E003F67DD /* LaunchScreen.xib */ = { 252 | isa = PBXVariantGroup; 253 | children = ( 254 | 9C57931F19CCCD3E003F67DD /* Base */, 255 | ); 256 | name = LaunchScreen.xib; 257 | sourceTree = ""; 258 | }; 259 | /* End PBXVariantGroup section */ 260 | 261 | /* Begin XCBuildConfiguration section */ 262 | 9C57932D19CCCD3E003F67DD /* Debug */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | ALWAYS_SEARCH_USER_PATHS = NO; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BOOL_CONVERSION = YES; 271 | CLANG_WARN_CONSTANT_CONVERSION = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_EMPTY_BODY = YES; 274 | CLANG_WARN_ENUM_CONVERSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | COPY_PHASE_STRIP = NO; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | GCC_C_LANGUAGE_STANDARD = gnu99; 283 | GCC_DYNAMIC_NO_PIC = NO; 284 | GCC_OPTIMIZATION_LEVEL = 0; 285 | GCC_PREPROCESSOR_DEFINITIONS = ( 286 | "DEBUG=1", 287 | "$(inherited)", 288 | ); 289 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = YES; 298 | ONLY_ACTIVE_ARCH = YES; 299 | SDKROOT = iphoneos; 300 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 301 | }; 302 | name = Debug; 303 | }; 304 | 9C57932E19CCCD3E003F67DD /* Release */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 322 | COPY_PHASE_STRIP = YES; 323 | ENABLE_NS_ASSERTIONS = NO; 324 | ENABLE_STRICT_OBJC_MSGSEND = YES; 325 | GCC_C_LANGUAGE_STANDARD = gnu99; 326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 328 | GCC_WARN_UNDECLARED_SELECTOR = YES; 329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 330 | GCC_WARN_UNUSED_FUNCTION = YES; 331 | GCC_WARN_UNUSED_VARIABLE = YES; 332 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 333 | MTL_ENABLE_DEBUG_INFO = NO; 334 | SDKROOT = iphoneos; 335 | VALIDATE_PRODUCT = YES; 336 | }; 337 | name = Release; 338 | }; 339 | 9C57933019CCCD3E003F67DD /* Debug */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 343 | INFOPLIST_FILE = OneShotLocationDemoApp/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 345 | PRODUCT_NAME = "$(TARGET_NAME)"; 346 | }; 347 | name = Debug; 348 | }; 349 | 9C57933119CCCD3E003F67DD /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 353 | INFOPLIST_FILE = OneShotLocationDemoApp/Info.plist; 354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 355 | PRODUCT_NAME = "$(TARGET_NAME)"; 356 | }; 357 | name = Release; 358 | }; 359 | 9C57933319CCCD3E003F67DD /* Debug */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | BUNDLE_LOADER = "$(TEST_HOST)"; 363 | FRAMEWORK_SEARCH_PATHS = ( 364 | "$(SDKROOT)/Developer/Library/Frameworks", 365 | "$(inherited)", 366 | ); 367 | GCC_PREPROCESSOR_DEFINITIONS = ( 368 | "DEBUG=1", 369 | "$(inherited)", 370 | ); 371 | INFOPLIST_FILE = OneShotLocationDemoAppTests/Info.plist; 372 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 373 | PRODUCT_NAME = "$(TARGET_NAME)"; 374 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OneShotLocationDemoApp.app/OneShotLocationDemoApp"; 375 | }; 376 | name = Debug; 377 | }; 378 | 9C57933419CCCD3E003F67DD /* Release */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | BUNDLE_LOADER = "$(TEST_HOST)"; 382 | FRAMEWORK_SEARCH_PATHS = ( 383 | "$(SDKROOT)/Developer/Library/Frameworks", 384 | "$(inherited)", 385 | ); 386 | INFOPLIST_FILE = OneShotLocationDemoAppTests/Info.plist; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OneShotLocationDemoApp.app/OneShotLocationDemoApp"; 390 | }; 391 | name = Release; 392 | }; 393 | /* End XCBuildConfiguration section */ 394 | 395 | /* Begin XCConfigurationList section */ 396 | 9C57930B19CCCD3E003F67DD /* Build configuration list for PBXProject "OneShotLocationDemoApp" */ = { 397 | isa = XCConfigurationList; 398 | buildConfigurations = ( 399 | 9C57932D19CCCD3E003F67DD /* Debug */, 400 | 9C57932E19CCCD3E003F67DD /* Release */, 401 | ); 402 | defaultConfigurationIsVisible = 0; 403 | defaultConfigurationName = Release; 404 | }; 405 | 9C57932F19CCCD3E003F67DD /* Build configuration list for PBXNativeTarget "OneShotLocationDemoApp" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | 9C57933019CCCD3E003F67DD /* Debug */, 409 | 9C57933119CCCD3E003F67DD /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | 9C57933219CCCD3E003F67DD /* Build configuration list for PBXNativeTarget "OneShotLocationDemoAppTests" */ = { 415 | isa = XCConfigurationList; 416 | buildConfigurations = ( 417 | 9C57933319CCCD3E003F67DD /* Debug */, 418 | 9C57933419CCCD3E003F67DD /* Release */, 419 | ); 420 | defaultConfigurationIsVisible = 0; 421 | defaultConfigurationName = Release; 422 | }; 423 | /* End XCConfigurationList section */ 424 | }; 425 | rootObject = 9C57930819CCCD3E003F67DD /* Project object */; 426 | } 427 | --------------------------------------------------------------------------------