├── README.md ├── .gitignore ├── promisesTests ├── Info.plist └── promisesTests.swift ├── promises ├── Info.plist ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── ViewController.swift ├── AppDelegate.swift └── Promise.swift ├── LICENSE └── promises.xcodeproj └── project.pbxproj /README.md: -------------------------------------------------------------------------------- 1 | swift-promises 2 | ============== 3 | 4 | Example implementation of promises in Swift 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | # Pods - for those of you who use CocoaPods 20 | Pods 21 | -------------------------------------------------------------------------------- /promisesTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.ringham.${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 | -------------------------------------------------------------------------------- /promisesTests/promisesTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // promisesTests.swift 3 | // promisesTests 4 | // 5 | // Created by Rob Ringham on 6/6/14. 6 | // Copyright (c) 2014 Ringham. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class promisesTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | // This is an example of a functional test case. 25 | XCTAssert(true, "Pass") 26 | } 27 | 28 | func testPerformanceExample() { 29 | // This is an example of a performance test case. 30 | self.measureBlock() { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /promises/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.ringham.${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 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /promises/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 rringham 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. -------------------------------------------------------------------------------- /promises/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /promises/Base.lproj/Main.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 | -------------------------------------------------------------------------------- /promises/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // promises 4 | // 5 | // Created by Rob Ringham on 6/7/14. 6 | // Copyright (c) 2014, Rob Ringham 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | import UIKit 28 | 29 | class ViewController: UIViewController { 30 | 31 | override func viewDidLoad() { 32 | super.viewDidLoad() 33 | 34 | // 35 | // Example #1 36 | // 37 | uploadFile().then({ 38 | // let the user know their file has been uploaded 39 | println("hooray, your file uploaded!") 40 | }).then({ 41 | // do something else here 42 | println("start next file upload, or something equally interesting") 43 | }).fail({ 44 | // alert the user that their file upload failed miserably 45 | println("all is lost. accept defeat.") 46 | }).done({ 47 | // we're done! 48 | println("all done!") 49 | }) 50 | 51 | // 52 | // Example #2 53 | // 54 | uploadFile().then({ 55 | // let the user know their file has been uploaded 56 | println("hooray, your file uploaded!") 57 | }).then({(promise: Promise) -> () in 58 | // something here failed, so lets reject 59 | // the whole thing and fall through to fail() 60 | promise.reject() 61 | }).fail({ 62 | // alert the user that their file upload failed miserably 63 | println("all is lost. accept defeat.") 64 | }).done({ 65 | // we're done! 66 | println("all done!") 67 | }) 68 | } 69 | 70 | func uploadFile() -> Promise { 71 | let p = Promise.defer() 72 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { 73 | let success = self.actualFileUpload() 74 | if !success { 75 | p.reject() 76 | } 77 | 78 | dispatch_async(dispatch_get_main_queue(), { 79 | p.resolve()() 80 | }) 81 | }) 82 | return p 83 | } 84 | 85 | func actualFileUpload() -> Bool { 86 | return true 87 | } 88 | } -------------------------------------------------------------------------------- /promises/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // promises 4 | // 5 | // Created by Rob Ringham on 6/7/14. 6 | // Copyright (c) 2014, Rob Ringham 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | import UIKit 28 | 29 | @UIApplicationMain 30 | class AppDelegate: UIResponder, UIApplicationDelegate { 31 | 32 | var window: UIWindow? 33 | 34 | 35 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { 36 | // Override point for customization after application launch. 37 | return true 38 | } 39 | 40 | func applicationWillResignActive(application: UIApplication) { 41 | // 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. 42 | // 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. 43 | } 44 | 45 | func applicationDidEnterBackground(application: UIApplication) { 46 | // 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. 47 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 48 | } 49 | 50 | func applicationWillEnterForeground(application: UIApplication) { 51 | // 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. 52 | } 53 | 54 | func applicationDidBecomeActive(application: UIApplication) { 55 | // 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. 56 | } 57 | 58 | func applicationWillTerminate(application: UIApplication) { 59 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 60 | } 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /promises/Promise.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Promise.swift 3 | // promises 4 | // 5 | // Created by Rob Ringham on 6/7/14. 6 | // Copyright (c) 2014, Rob Ringham 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | import Foundation 28 | 29 | protocol Finishable { 30 | func done(done: (() -> ())) -> () 31 | } 32 | 33 | class Promise : Finishable { 34 | // An array of callbacks (Void -> Void) to iterate through at resolve time. 35 | var pending: (() -> ())[] = [] 36 | 37 | // A callback to call when we're completely done. 38 | var done: (() -> ()) = {} 39 | 40 | // A callback to invoke in the event of failure. 41 | var fail: (() -> ()) = {} 42 | 43 | // A simple way to track rejection. 44 | var rejected: Bool = false 45 | 46 | // Class ("static") method to return a new promise. 47 | class func defer() -> Promise { 48 | return Promise() 49 | } 50 | 51 | // Resolve method. 52 | // 53 | // Returns a resolve function that loops through pending callbacks, 54 | // invoking each in sequence. 55 | // 56 | // Invokes fail callback in case of rejection (and swiftly abandons ship). 57 | func resolve() -> (() -> ()) { 58 | func resolve() -> () { 59 | for f in self.pending { 60 | if self.rejected { 61 | fail() 62 | return 63 | } 64 | f() 65 | } 66 | if self.rejected { 67 | fail() 68 | return 69 | } 70 | done() 71 | } 72 | return resolve 73 | } 74 | 75 | // Reject method. 76 | // 77 | // Sets rejection flag to true to halt execution of subsequent callbacks. 78 | func reject() -> () { 79 | self.rejected = true 80 | } 81 | 82 | // Then method. 83 | // 84 | // This lets us chain callbacks together; it accepts one parameter, a Void -> Void 85 | // callback - can either be a function itself, or a Swift closure. 86 | func then(callback: (() -> ())) -> Promise { 87 | self.pending.append(callback) 88 | return self 89 | } 90 | 91 | // Then method override. 92 | // 93 | // This also lets us chain callbacks together; it accepts one parameter, 94 | // but unlike the previous implementation of then(), it accepts a Promise -> Void 95 | // callback (which can either be a function itself, or a Swift closure). 96 | // 97 | // This method then wraps that callback in a Void -> Void callback that 98 | // passes in this Promise object when invoking the callback() function. 99 | // 100 | // This allows users of our Promise library to have access to the Promise object, 101 | // so that they can reject a Promise within their then() clauses. Not the cleanest 102 | // way, but hey, this whole thing is a proof of concept, right? :) 103 | func then(callback: ((promise: Promise) -> ())) -> Promise { 104 | func thenWrapper() -> () { 105 | callback(promise: self) 106 | } 107 | self.pending.append(thenWrapper) 108 | return self 109 | } 110 | 111 | // Fail method. 112 | // 113 | // This lets us chain a fail() method at the end of a set of then() clauses. 114 | // 115 | // Note that unlike then(), this does not return a Promise object. It returns 116 | // a "Finishable" object, which locks users down to only being able to specify 117 | // a done() clause after a fail() clause. This is to prevent users from being 118 | // able to do something like this: 119 | // 120 | // promise.then({}).fail({}).then({}).fail({}) 121 | // 122 | func fail(fail: (() -> ())) -> Finishable { 123 | self.fail = fail 124 | let finishablePromise : Finishable = self 125 | return finishablePromise 126 | } 127 | 128 | // Done method. 129 | // 130 | // This lets us specify a done() callback to be invoked at the end of a set 131 | // of then() clauses (provided the promise hasn't been rejected). 132 | func done(done: (() -> ())) -> () { 133 | self.done = done 134 | } 135 | } -------------------------------------------------------------------------------- /promises.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9B02A4AA19425AC800F9AA3B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B02A4A919425AC800F9AA3B /* AppDelegate.swift */; }; 11 | 9B02A4AC19425AC800F9AA3B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B02A4AB19425AC800F9AA3B /* ViewController.swift */; }; 12 | 9B02A4AF19425AC800F9AA3B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B02A4AD19425AC800F9AA3B /* Main.storyboard */; }; 13 | 9B02A4B119425AC800F9AA3B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9B02A4B019425AC800F9AA3B /* Images.xcassets */; }; 14 | 9B02A4BD19425AC900F9AA3B /* promisesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B02A4BC19425AC900F9AA3B /* promisesTests.swift */; }; 15 | 9B02A4C719425ADF00F9AA3B /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B02A4C619425ADF00F9AA3B /* Promise.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | 9B02A4B719425AC900F9AA3B /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = 9B02A49C19425AC800F9AA3B /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = 9B02A4A319425AC800F9AA3B; 24 | remoteInfo = promises; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 9B02A4A419425AC800F9AA3B /* promises.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = promises.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 9B02A4A819425AC800F9AA3B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 9B02A4A919425AC800F9AA3B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 32 | 9B02A4AB19425AC800F9AA3B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 33 | 9B02A4AE19425AC800F9AA3B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | 9B02A4B019425AC800F9AA3B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 35 | 9B02A4B619425AC900F9AA3B /* promisesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = promisesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 9B02A4BB19425AC900F9AA3B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 9B02A4BC19425AC900F9AA3B /* promisesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = promisesTests.swift; sourceTree = ""; }; 38 | 9B02A4C619425ADF00F9AA3B /* Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Promise.swift; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 9B02A4A119425AC800F9AA3B /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | 9B02A4B319425AC900F9AA3B /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 9B02A49B19425AC800F9AA3B = { 60 | isa = PBXGroup; 61 | children = ( 62 | 9B02A4A619425AC800F9AA3B /* promises */, 63 | 9B02A4B919425AC900F9AA3B /* promisesTests */, 64 | 9B02A4A519425AC800F9AA3B /* Products */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | 9B02A4A519425AC800F9AA3B /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 9B02A4A419425AC800F9AA3B /* promises.app */, 72 | 9B02A4B619425AC900F9AA3B /* promisesTests.xctest */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | 9B02A4A619425AC800F9AA3B /* promises */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 9B02A4A919425AC800F9AA3B /* AppDelegate.swift */, 81 | 9B02A4AB19425AC800F9AA3B /* ViewController.swift */, 82 | 9B02A4C619425ADF00F9AA3B /* Promise.swift */, 83 | 9B02A4AD19425AC800F9AA3B /* Main.storyboard */, 84 | 9B02A4B019425AC800F9AA3B /* Images.xcassets */, 85 | 9B02A4A719425AC800F9AA3B /* Supporting Files */, 86 | ); 87 | path = promises; 88 | sourceTree = ""; 89 | }; 90 | 9B02A4A719425AC800F9AA3B /* Supporting Files */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9B02A4A819425AC800F9AA3B /* Info.plist */, 94 | ); 95 | name = "Supporting Files"; 96 | sourceTree = ""; 97 | }; 98 | 9B02A4B919425AC900F9AA3B /* promisesTests */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 9B02A4BC19425AC900F9AA3B /* promisesTests.swift */, 102 | 9B02A4BA19425AC900F9AA3B /* Supporting Files */, 103 | ); 104 | path = promisesTests; 105 | sourceTree = ""; 106 | }; 107 | 9B02A4BA19425AC900F9AA3B /* Supporting Files */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 9B02A4BB19425AC900F9AA3B /* Info.plist */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXNativeTarget section */ 118 | 9B02A4A319425AC800F9AA3B /* promises */ = { 119 | isa = PBXNativeTarget; 120 | buildConfigurationList = 9B02A4C019425AC900F9AA3B /* Build configuration list for PBXNativeTarget "promises" */; 121 | buildPhases = ( 122 | 9B02A4A019425AC800F9AA3B /* Sources */, 123 | 9B02A4A119425AC800F9AA3B /* Frameworks */, 124 | 9B02A4A219425AC800F9AA3B /* Resources */, 125 | ); 126 | buildRules = ( 127 | ); 128 | dependencies = ( 129 | ); 130 | name = promises; 131 | productName = promises; 132 | productReference = 9B02A4A419425AC800F9AA3B /* promises.app */; 133 | productType = "com.apple.product-type.application"; 134 | }; 135 | 9B02A4B519425AC900F9AA3B /* promisesTests */ = { 136 | isa = PBXNativeTarget; 137 | buildConfigurationList = 9B02A4C319425AC900F9AA3B /* Build configuration list for PBXNativeTarget "promisesTests" */; 138 | buildPhases = ( 139 | 9B02A4B219425AC900F9AA3B /* Sources */, 140 | 9B02A4B319425AC900F9AA3B /* Frameworks */, 141 | 9B02A4B419425AC900F9AA3B /* Resources */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | 9B02A4B819425AC900F9AA3B /* PBXTargetDependency */, 147 | ); 148 | name = promisesTests; 149 | productName = promisesTests; 150 | productReference = 9B02A4B619425AC900F9AA3B /* promisesTests.xctest */; 151 | productType = "com.apple.product-type.bundle.unit-test"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 9B02A49C19425AC800F9AA3B /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 0600; 160 | ORGANIZATIONNAME = Ringham; 161 | TargetAttributes = { 162 | 9B02A4A319425AC800F9AA3B = { 163 | CreatedOnToolsVersion = 6.0; 164 | }; 165 | 9B02A4B519425AC900F9AA3B = { 166 | CreatedOnToolsVersion = 6.0; 167 | TestTargetID = 9B02A4A319425AC800F9AA3B; 168 | }; 169 | }; 170 | }; 171 | buildConfigurationList = 9B02A49F19425AC800F9AA3B /* Build configuration list for PBXProject "promises" */; 172 | compatibilityVersion = "Xcode 3.2"; 173 | developmentRegion = English; 174 | hasScannedForEncodings = 0; 175 | knownRegions = ( 176 | en, 177 | Base, 178 | ); 179 | mainGroup = 9B02A49B19425AC800F9AA3B; 180 | productRefGroup = 9B02A4A519425AC800F9AA3B /* Products */; 181 | projectDirPath = ""; 182 | projectRoot = ""; 183 | targets = ( 184 | 9B02A4A319425AC800F9AA3B /* promises */, 185 | 9B02A4B519425AC900F9AA3B /* promisesTests */, 186 | ); 187 | }; 188 | /* End PBXProject section */ 189 | 190 | /* Begin PBXResourcesBuildPhase section */ 191 | 9B02A4A219425AC800F9AA3B /* Resources */ = { 192 | isa = PBXResourcesBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 9B02A4AF19425AC800F9AA3B /* Main.storyboard in Resources */, 196 | 9B02A4B119425AC800F9AA3B /* Images.xcassets in Resources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | 9B02A4B419425AC900F9AA3B /* Resources */ = { 201 | isa = PBXResourcesBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXResourcesBuildPhase section */ 208 | 209 | /* Begin PBXSourcesBuildPhase section */ 210 | 9B02A4A019425AC800F9AA3B /* Sources */ = { 211 | isa = PBXSourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 9B02A4AC19425AC800F9AA3B /* ViewController.swift in Sources */, 215 | 9B02A4AA19425AC800F9AA3B /* AppDelegate.swift in Sources */, 216 | 9B02A4C719425ADF00F9AA3B /* Promise.swift in Sources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | 9B02A4B219425AC900F9AA3B /* Sources */ = { 221 | isa = PBXSourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | 9B02A4BD19425AC900F9AA3B /* promisesTests.swift in Sources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXSourcesBuildPhase section */ 229 | 230 | /* Begin PBXTargetDependency section */ 231 | 9B02A4B819425AC900F9AA3B /* PBXTargetDependency */ = { 232 | isa = PBXTargetDependency; 233 | target = 9B02A4A319425AC800F9AA3B /* promises */; 234 | targetProxy = 9B02A4B719425AC900F9AA3B /* PBXContainerItemProxy */; 235 | }; 236 | /* End PBXTargetDependency section */ 237 | 238 | /* Begin PBXVariantGroup section */ 239 | 9B02A4AD19425AC800F9AA3B /* Main.storyboard */ = { 240 | isa = PBXVariantGroup; 241 | children = ( 242 | 9B02A4AE19425AC800F9AA3B /* Base */, 243 | ); 244 | name = Main.storyboard; 245 | sourceTree = ""; 246 | }; 247 | /* End PBXVariantGroup section */ 248 | 249 | /* Begin XCBuildConfiguration section */ 250 | 9B02A4BE19425AC900F9AA3B /* Debug */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | ALWAYS_SEARCH_USER_PATHS = NO; 254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 255 | CLANG_CXX_LIBRARY = "libc++"; 256 | CLANG_ENABLE_MODULES = YES; 257 | CLANG_ENABLE_OBJC_ARC = YES; 258 | CLANG_WARN_BOOL_CONVERSION = YES; 259 | CLANG_WARN_CONSTANT_CONVERSION = YES; 260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 261 | CLANG_WARN_EMPTY_BODY = YES; 262 | CLANG_WARN_ENUM_CONVERSION = YES; 263 | CLANG_WARN_INT_CONVERSION = YES; 264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 265 | CLANG_WARN_UNREACHABLE_CODE = YES; 266 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 267 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 268 | COPY_PHASE_STRIP = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu99; 271 | GCC_DYNAMIC_NO_PIC = NO; 272 | GCC_OPTIMIZATION_LEVEL = 0; 273 | GCC_PREPROCESSOR_DEFINITIONS = ( 274 | "DEBUG=1", 275 | "$(inherited)", 276 | ); 277 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 280 | GCC_WARN_UNDECLARED_SELECTOR = YES; 281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 282 | GCC_WARN_UNUSED_FUNCTION = YES; 283 | GCC_WARN_UNUSED_VARIABLE = YES; 284 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 285 | METAL_ENABLE_DEBUG_INFO = YES; 286 | ONLY_ACTIVE_ARCH = YES; 287 | SDKROOT = iphoneos; 288 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 289 | TARGETED_DEVICE_FAMILY = "1,2"; 290 | }; 291 | name = Debug; 292 | }; 293 | 9B02A4BF19425AC900F9AA3B /* Release */ = { 294 | isa = XCBuildConfiguration; 295 | buildSettings = { 296 | ALWAYS_SEARCH_USER_PATHS = NO; 297 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 298 | CLANG_CXX_LIBRARY = "libc++"; 299 | CLANG_ENABLE_MODULES = YES; 300 | CLANG_ENABLE_OBJC_ARC = YES; 301 | CLANG_WARN_BOOL_CONVERSION = YES; 302 | CLANG_WARN_CONSTANT_CONVERSION = YES; 303 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 304 | CLANG_WARN_EMPTY_BODY = YES; 305 | CLANG_WARN_ENUM_CONVERSION = YES; 306 | CLANG_WARN_INT_CONVERSION = YES; 307 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 308 | CLANG_WARN_UNREACHABLE_CODE = YES; 309 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 310 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 311 | COPY_PHASE_STRIP = YES; 312 | ENABLE_NS_ASSERTIONS = NO; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu99; 315 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 316 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 317 | GCC_WARN_UNDECLARED_SELECTOR = YES; 318 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 319 | GCC_WARN_UNUSED_FUNCTION = YES; 320 | GCC_WARN_UNUSED_VARIABLE = YES; 321 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 322 | METAL_ENABLE_DEBUG_INFO = NO; 323 | SDKROOT = iphoneos; 324 | TARGETED_DEVICE_FAMILY = "1,2"; 325 | VALIDATE_PRODUCT = YES; 326 | }; 327 | name = Release; 328 | }; 329 | 9B02A4C119425AC900F9AA3B /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 333 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 334 | INFOPLIST_FILE = promises/Info.plist; 335 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 336 | PRODUCT_NAME = "$(TARGET_NAME)"; 337 | }; 338 | name = Debug; 339 | }; 340 | 9B02A4C219425AC900F9AA3B /* Release */ = { 341 | isa = XCBuildConfiguration; 342 | buildSettings = { 343 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 344 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 345 | INFOPLIST_FILE = promises/Info.plist; 346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 347 | PRODUCT_NAME = "$(TARGET_NAME)"; 348 | }; 349 | name = Release; 350 | }; 351 | 9B02A4C419425AC900F9AA3B /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/promises.app/promises"; 355 | FRAMEWORK_SEARCH_PATHS = ( 356 | "$(SDKROOT)/Developer/Library/Frameworks", 357 | "$(inherited)", 358 | ); 359 | GCC_PREPROCESSOR_DEFINITIONS = ( 360 | "DEBUG=1", 361 | "$(inherited)", 362 | ); 363 | INFOPLIST_FILE = promisesTests/Info.plist; 364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 365 | METAL_ENABLE_DEBUG_INFO = YES; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | TEST_HOST = "$(BUNDLE_LOADER)"; 368 | }; 369 | name = Debug; 370 | }; 371 | 9B02A4C519425AC900F9AA3B /* Release */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/promises.app/promises"; 375 | FRAMEWORK_SEARCH_PATHS = ( 376 | "$(SDKROOT)/Developer/Library/Frameworks", 377 | "$(inherited)", 378 | ); 379 | INFOPLIST_FILE = promisesTests/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 381 | METAL_ENABLE_DEBUG_INFO = NO; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | TEST_HOST = "$(BUNDLE_LOADER)"; 384 | }; 385 | name = Release; 386 | }; 387 | /* End XCBuildConfiguration section */ 388 | 389 | /* Begin XCConfigurationList section */ 390 | 9B02A49F19425AC800F9AA3B /* Build configuration list for PBXProject "promises" */ = { 391 | isa = XCConfigurationList; 392 | buildConfigurations = ( 393 | 9B02A4BE19425AC900F9AA3B /* Debug */, 394 | 9B02A4BF19425AC900F9AA3B /* Release */, 395 | ); 396 | defaultConfigurationIsVisible = 0; 397 | defaultConfigurationName = Release; 398 | }; 399 | 9B02A4C019425AC900F9AA3B /* Build configuration list for PBXNativeTarget "promises" */ = { 400 | isa = XCConfigurationList; 401 | buildConfigurations = ( 402 | 9B02A4C119425AC900F9AA3B /* Debug */, 403 | 9B02A4C219425AC900F9AA3B /* Release */, 404 | ); 405 | defaultConfigurationIsVisible = 0; 406 | defaultConfigurationName = Release; 407 | }; 408 | 9B02A4C319425AC900F9AA3B /* Build configuration list for PBXNativeTarget "promisesTests" */ = { 409 | isa = XCConfigurationList; 410 | buildConfigurations = ( 411 | 9B02A4C419425AC900F9AA3B /* Debug */, 412 | 9B02A4C519425AC900F9AA3B /* Release */, 413 | ); 414 | defaultConfigurationIsVisible = 0; 415 | defaultConfigurationName = Release; 416 | }; 417 | /* End XCConfigurationList section */ 418 | }; 419 | rootObject = 9B02A49C19425AC800F9AA3B /* Project object */; 420 | } 421 | --------------------------------------------------------------------------------