├── README.md ├── .gitignore ├── calculator ├── calculator.xcodeproj │ ├── xcuserdata │ │ └── cor.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── calculator.xcscheme │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── cor.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── project.pbxproj ├── calculatorTests │ ├── Info.plist │ └── calculatorTests.swift ├── calculatorUITests │ ├── Info.plist │ └── calculatorUITests.swift └── calculator │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── AppDelegate.swift │ ├── ViewController.swift │ └── CalculatorCore.swift └── FaceIt ├── FaceIt.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── cor.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ └── cor.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── FaceIt.xcscheme └── project.pbxproj └── FaceIt ├── FaceViewController.swift ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Info.plist ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── AppDelegate.swift └── FaceView.swift /README.md: -------------------------------------------------------------------------------- 1 | # stanford-ios 2 | Projects for Stanford's iOS course on iTunes U 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | FaceIt/FaceIt.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate 2 | -------------------------------------------------------------------------------- /calculator/calculator.xcodeproj/xcuserdata/cor.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /FaceIt/FaceIt.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FaceIt/FaceIt.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoR/stanford-ios/master/FaceIt/FaceIt.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /calculator/calculator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /calculator/calculator.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoR/stanford-ios/master/calculator/calculator.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /FaceIt/FaceIt/FaceViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // FaceIt 4 | // 5 | // Created by Cor Pruijs on 17-05-16. 6 | // Copyright © 2016 CorCoder. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FaceViewController: UIViewController { 12 | 13 | 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /FaceIt/FaceIt.xcodeproj/xcuserdata/cor.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FaceIt.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 87BD02DA1CEB8CED00FEBBE1 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /calculator/calculatorTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /calculator/calculatorUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /calculator/calculator.xcodeproj/xcuserdata/cor.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | calculator.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8761A3201CD1079100C315E7 16 | 17 | primary 18 | 19 | 20 | 8761A3341CD1079200C315E7 21 | 22 | primary 23 | 24 | 25 | 8761A33F1CD1079200C315E7 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /calculator/calculatorTests/calculatorTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // calculatorTests.swift 3 | // calculatorTests 4 | // 5 | // Created by Cor Pruijs on 27-04-16. 6 | // Copyright © 2016 CorCoder. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import calculator 11 | 12 | class calculatorTests: 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 | // Use XCTAssert and related functions to verify your tests produce the correct results. 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 | -------------------------------------------------------------------------------- /calculator/calculator/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /calculator/calculatorUITests/calculatorUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // calculatorUITests.swift 3 | // calculatorUITests 4 | // 5 | // Created by Cor Pruijs on 27-04-16. 6 | // Copyright © 2016 CorCoder. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class calculatorUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /FaceIt/FaceIt/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /FaceIt/FaceIt/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 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /calculator/calculator/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 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /FaceIt/FaceIt/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 | -------------------------------------------------------------------------------- /calculator/calculator/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 | -------------------------------------------------------------------------------- /FaceIt/FaceIt/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // FaceIt 4 | // 5 | // Created by Cor Pruijs on 17-05-16. 6 | // Copyright © 2016 CorCoder. 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 | -------------------------------------------------------------------------------- /calculator/calculator/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // calculator 4 | // 5 | // Created by Cor Pruijs on 27-04-16. 6 | // Copyright © 2016 CorCoder. 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 | -------------------------------------------------------------------------------- /calculator/calculator/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // calculator 4 | // 5 | // Created by Cor Pruijs on 27-04-16. 6 | // Copyright © 2016 CorCoder. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | private var core = CalculatorCore() 14 | 15 | // MARK: - Outlets 16 | @IBOutlet private weak var display: UILabel! 17 | @IBOutlet private weak var descriptionDisplay: UILabel! 18 | 19 | 20 | // MARK: - Private Properties 21 | private var userIsTyping = false 22 | private var displayValue: Double { 23 | get { 24 | return Double(display.text!)! 25 | } 26 | set { 27 | display.text = String(newValue) 28 | } 29 | } 30 | 31 | private func updateDescriptionDisplay() { 32 | descriptionDisplay.text = core.description 33 | if core.resultIsPartial { 34 | descriptionDisplay.text! += " ..." 35 | } 36 | } 37 | 38 | // MARK: - Input Handeling 39 | @IBAction private func operandButtonPressed(sender: UIButton) { 40 | 41 | // Extract the entered digit from the current title 42 | let digit = sender.currentTitle! 43 | 44 | // Update the displaytext depending on whether the user is typing or not 45 | display.text = userIsTyping ? display.text! + digit : digit 46 | 47 | // The user is now typing since he just entered a digit 48 | userIsTyping = true 49 | updateDescriptionDisplay() 50 | } 51 | 52 | @IBAction func pointButtonPressed(sender: UIButton) { 53 | 54 | // Check if the number already contains a decimal point 55 | if !display.text!.containsString(".") { 56 | // If it doesn't, add a decimal point 57 | display.text! += "." 58 | } 59 | updateDescriptionDisplay() 60 | } 61 | 62 | @IBAction func clearButtonPressed(sender: UIButton) { 63 | // Reset everything 64 | core.reset() 65 | updateDescriptionDisplay() 66 | displayValue = core.result 67 | } 68 | 69 | @IBAction private func operatorButtonPressed(sender: UIButton) { 70 | 71 | if userIsTyping { 72 | core.setOperand(displayValue) 73 | userIsTyping = false 74 | } 75 | 76 | userIsTyping = false 77 | 78 | if let mathematicalSymbol = sender.currentTitle { 79 | core.performOperation(mathematicalSymbol) 80 | } 81 | 82 | displayValue = core.result 83 | updateDescriptionDisplay() 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /FaceIt/FaceIt/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /FaceIt/FaceIt.xcodeproj/xcuserdata/cor.xcuserdatad/xcschemes/FaceIt.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 | -------------------------------------------------------------------------------- /calculator/calculator/CalculatorCore.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CalculatorCore.swift 3 | // calculator 4 | // 5 | // Created by Cor Pruijs on 28-04-16. 6 | // Copyright © 2016 CorCoder. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class CalculatorCore { 12 | 13 | // MARK: - Properties 14 | private var accumulator = 0.0 15 | private var operations = [String:Operation]() 16 | private var history = [String]() 17 | 18 | internal var description: String { 19 | get { 20 | return history.joinWithSeparator(" ") 21 | } 22 | } 23 | 24 | internal var resultIsPartial: Bool { 25 | get { 26 | return pending != nil 27 | } 28 | } 29 | 30 | // MARK: - Initalization 31 | init() { 32 | initializeOperations() 33 | } 34 | 35 | private func initializeOperations() { 36 | 37 | // Constants 38 | operations["π"] = .constant(M_PI) 39 | operations["e"] = .constant(M_E) 40 | operations["C"] = .constant(Double(0)) 41 | 42 | // Unary Operations 43 | operations["√"] = .unaryOperation(sqrt) 44 | operations["cos"] = .unaryOperation(cos) 45 | operations["sin"] = .unaryOperation(sin) 46 | operations["tan"] = .unaryOperation(tan) 47 | operations["±"] = .unaryOperation({ -$0 }) 48 | 49 | // Binary Operations 50 | operations["×"] = .binaryOperation(*) 51 | operations["+"] = .binaryOperation(+) 52 | operations["−"] = .binaryOperation(-) 53 | operations["÷"] = .binaryOperation(/) 54 | 55 | // Equals 56 | operations["="] = .equals 57 | } 58 | 59 | 60 | // MARK: - Internal Interface 61 | internal var result: Double { 62 | get { 63 | return accumulator 64 | } 65 | } 66 | 67 | internal func setOperand(operand: Double) { 68 | accumulator = operand 69 | history.append(String(operand)) 70 | } 71 | 72 | internal func performOperation(symbol: String) { 73 | if let operation = operations[symbol] { 74 | switch operation { 75 | case .constant(let value): 76 | accumulator = value 77 | case .unaryOperation(let function): 78 | accumulator = function(accumulator) 79 | case .binaryOperation(let function): 80 | executePendingBinaryOperation() 81 | pending = PendingBinaryOperationInfo(binaryFunction: function, firstOperand: accumulator) 82 | case .equals: 83 | executePendingBinaryOperation() 84 | } 85 | } else { 86 | print("Operation \(symbol) doesn't exist") 87 | } 88 | history.append(symbol) 89 | } 90 | 91 | internal func reset() { 92 | accumulator = 0.0 93 | pending = nil 94 | history = [] 95 | } 96 | 97 | // MARK: - Binary Operation Logic 98 | private struct PendingBinaryOperationInfo { 99 | let binaryFunction: (Double, Double) -> Double 100 | let firstOperand: Double 101 | } 102 | 103 | private var pending: PendingBinaryOperationInfo? 104 | 105 | private func executePendingBinaryOperation() { 106 | if pending != nil { 107 | accumulator = pending!.binaryFunction(pending!.firstOperand, accumulator) 108 | pending = nil 109 | } 110 | } 111 | 112 | // MARK: - Operation Type 113 | private enum Operation { 114 | case constant(Double) 115 | case unaryOperation((Double) -> Double) 116 | case binaryOperation((Double, Double) -> Double) 117 | case equals 118 | } 119 | } -------------------------------------------------------------------------------- /calculator/calculator.xcodeproj/xcuserdata/cor.xcuserdatad/xcschemes/calculator.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /FaceIt/FaceIt/FaceView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FaceView.swift 3 | // FaceIt 4 | // 5 | // Created by Cor Pruijs on 17-05-16. 6 | // Copyright © 2016 CorCoder. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FaceView: UIView { 12 | 13 | internal var scale: CGFloat = 0.90 14 | internal var color: UIColor = UIColor.redColor() 15 | internal var mouthCurvature: Double = 1.0 // 1 full smile, -1 full frown 16 | internal var eyesAreOpen = true 17 | internal var eyeBrowTilt = -0.5 // -1 full furrow, 1 fgully relaxed 18 | internal var lineWidth: CGFloat = 6.0 19 | 20 | 21 | private var skullRadius: CGFloat { 22 | return min(bounds.size.width, bounds.size.height) / 2 * scale 23 | } 24 | private var skullCenter: CGPoint { 25 | return CGPoint(x: bounds.midX, y: bounds.midY) 26 | } 27 | 28 | private struct Ratios { 29 | static let SkullRadiusToEyeOffset: CGFloat = 3 30 | static let SkullRadiusToEyeRadius: CGFloat = 10 31 | static let SkullRadiusToMouthWidth: CGFloat = 1 32 | static let SkullRadiusToMouthHeight: CGFloat = 3 33 | static let SkullRadiusToMouthOffset: CGFloat = 3 34 | static let SkullRadiusToBrowOffset: CGFloat = 5 35 | } 36 | 37 | private enum Eye { 38 | case Left 39 | case Right 40 | } 41 | 42 | private func pathForCircleCenteredAtPoint(midPoint: CGPoint, withRadius radius: CGFloat) -> UIBezierPath { 43 | let path = UIBezierPath( 44 | arcCenter: midPoint, 45 | radius: radius, 46 | startAngle: 0, 47 | endAngle: CGFloat(2 * M_PI), 48 | clockwise: true 49 | ) 50 | path.lineWidth = lineWidth 51 | return path 52 | } 53 | 54 | private func getEyeCenter(eye: Eye) -> CGPoint { 55 | 56 | let eyeOffset = skullRadius / Ratios.SkullRadiusToEyeOffset 57 | var eyeCenter = skullCenter 58 | 59 | eyeCenter.y -= eyeOffset 60 | 61 | switch eye { 62 | case .Left: eyeCenter.x -= eyeOffset 63 | case .Right: eyeCenter.x += eyeOffset 64 | } 65 | 66 | return eyeCenter 67 | } 68 | 69 | private func pathForEye(eye: Eye) -> UIBezierPath { 70 | 71 | let eyeRadius = skullRadius / Ratios.SkullRadiusToEyeRadius 72 | let eyeCenter = getEyeCenter(eye) 73 | if eyesAreOpen { 74 | return pathForCircleCenteredAtPoint(eyeCenter, withRadius: eyeRadius) 75 | } else { 76 | let path = UIBezierPath() 77 | path.moveToPoint(CGPoint(x: eyeCenter.x - eyeRadius, y: eyeCenter.y)) 78 | path.addLineToPoint(CGPoint(x: eyeCenter.x + eyeRadius, y: eyeCenter.y)) 79 | path.lineWidth = lineWidth 80 | return path 81 | } 82 | 83 | } 84 | 85 | private func pathForBrow(eye: Eye) -> UIBezierPath { 86 | var tilt = eyeBrowTilt 87 | 88 | switch eye { 89 | case .Left: tilt *= -1.0 90 | case .Right: break 91 | } 92 | 93 | var browCenter = getEyeCenter(eye) 94 | browCenter.y -= skullRadius / Ratios.SkullRadiusToBrowOffset 95 | let eyeRadius = skullRadius / Ratios.SkullRadiusToEyeRadius 96 | let tiltOffset = CGFloat(max(-1, min(tilt, 1))) * eyeRadius / 2 97 | let browStart = CGPoint(x: browCenter.x - eyeRadius, y: browCenter.y - tiltOffset) 98 | let browEnd = CGPoint(x: browCenter.x + eyeRadius, y: browCenter.y + tiltOffset) 99 | 100 | let path = UIBezierPath() 101 | path.moveToPoint(browStart) 102 | path.addLineToPoint(browEnd) 103 | path.lineWidth = lineWidth 104 | 105 | return path 106 | } 107 | 108 | private func pathForMouth() -> UIBezierPath { 109 | let mouthWidth = skullRadius / Ratios.SkullRadiusToMouthWidth 110 | let mouthHeight = skullRadius / Ratios.SkullRadiusToMouthHeight 111 | let mouthOffset = skullRadius / Ratios.SkullRadiusToMouthOffset 112 | 113 | let mouthRect = CGRect(x: skullCenter.x - mouthWidth / 2, 114 | y: skullCenter.y + mouthOffset, 115 | width: mouthWidth, 116 | height: mouthHeight 117 | ) 118 | 119 | 120 | let smileOffset = CGFloat(max(-1, min(mouthCurvature, 1))) * mouthRect.height 121 | let start = CGPoint(x: mouthRect.minX, y: mouthRect.minY) 122 | let end = CGPoint(x: mouthRect.maxX, y: mouthRect.minY) 123 | let cp1 = CGPoint(x: mouthRect.minX + mouthRect.width / 3, y: mouthRect.minY + smileOffset) 124 | let cp2 = CGPoint(x: mouthRect.maxX - mouthRect.width / 3, y: mouthRect.minY + smileOffset) 125 | 126 | let path = UIBezierPath() 127 | path.moveToPoint(start) 128 | path.addCurveToPoint(end, controlPoint1: cp1, controlPoint2: cp2) 129 | path.lineWidth = lineWidth 130 | 131 | return path 132 | } 133 | 134 | 135 | override func drawRect(rect: CGRect) { 136 | 137 | color.set() 138 | pathForCircleCenteredAtPoint(skullCenter, withRadius: skullRadius).stroke() 139 | pathForEye(.Left).stroke() 140 | pathForEye(.Right).stroke() 141 | pathForBrow(.Left).stroke() 142 | pathForBrow(.Right).stroke() 143 | pathForMouth().stroke() 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /FaceIt/FaceIt.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 87BD02DF1CEB8CED00FEBBE1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87BD02DE1CEB8CED00FEBBE1 /* AppDelegate.swift */; }; 11 | 87BD02E11CEB8CED00FEBBE1 /* FaceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87BD02E01CEB8CED00FEBBE1 /* FaceViewController.swift */; }; 12 | 87BD02E41CEB8CED00FEBBE1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 87BD02E21CEB8CED00FEBBE1 /* Main.storyboard */; }; 13 | 87BD02E61CEB8CED00FEBBE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87BD02E51CEB8CED00FEBBE1 /* Assets.xcassets */; }; 14 | 87BD02E91CEB8CED00FEBBE1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 87BD02E71CEB8CED00FEBBE1 /* LaunchScreen.storyboard */; }; 15 | 87BD02F21CEB8E1000FEBBE1 /* FaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87BD02F11CEB8E1000FEBBE1 /* FaceView.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 87BD02DB1CEB8CED00FEBBE1 /* FaceIt.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FaceIt.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 87BD02DE1CEB8CED00FEBBE1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 87BD02E01CEB8CED00FEBBE1 /* FaceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceViewController.swift; sourceTree = ""; }; 22 | 87BD02E31CEB8CED00FEBBE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 87BD02E51CEB8CED00FEBBE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 87BD02E81CEB8CED00FEBBE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | 87BD02EA1CEB8CED00FEBBE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 87BD02F11CEB8E1000FEBBE1 /* FaceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaceView.swift; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 87BD02D81CEB8CED00FEBBE1 /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 87BD02D21CEB8CED00FEBBE1 = { 41 | isa = PBXGroup; 42 | children = ( 43 | 87BD02DD1CEB8CED00FEBBE1 /* FaceIt */, 44 | 87BD02DC1CEB8CED00FEBBE1 /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 87BD02DC1CEB8CED00FEBBE1 /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 87BD02DB1CEB8CED00FEBBE1 /* FaceIt.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 87BD02DD1CEB8CED00FEBBE1 /* FaceIt */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 87BD02F01CEB8D6400FEBBE1 /* Supporting files */, 60 | 87BD02E01CEB8CED00FEBBE1 /* FaceViewController.swift */, 61 | 87BD02F11CEB8E1000FEBBE1 /* FaceView.swift */, 62 | 87BD02E21CEB8CED00FEBBE1 /* Main.storyboard */, 63 | ); 64 | path = FaceIt; 65 | sourceTree = ""; 66 | }; 67 | 87BD02F01CEB8D6400FEBBE1 /* Supporting files */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 87BD02DE1CEB8CED00FEBBE1 /* AppDelegate.swift */, 71 | 87BD02E51CEB8CED00FEBBE1 /* Assets.xcassets */, 72 | 87BD02E71CEB8CED00FEBBE1 /* LaunchScreen.storyboard */, 73 | 87BD02EA1CEB8CED00FEBBE1 /* Info.plist */, 74 | ); 75 | name = "Supporting files"; 76 | sourceTree = ""; 77 | }; 78 | /* End PBXGroup section */ 79 | 80 | /* Begin PBXNativeTarget section */ 81 | 87BD02DA1CEB8CED00FEBBE1 /* FaceIt */ = { 82 | isa = PBXNativeTarget; 83 | buildConfigurationList = 87BD02ED1CEB8CED00FEBBE1 /* Build configuration list for PBXNativeTarget "FaceIt" */; 84 | buildPhases = ( 85 | 87BD02D71CEB8CED00FEBBE1 /* Sources */, 86 | 87BD02D81CEB8CED00FEBBE1 /* Frameworks */, 87 | 87BD02D91CEB8CED00FEBBE1 /* Resources */, 88 | ); 89 | buildRules = ( 90 | ); 91 | dependencies = ( 92 | ); 93 | name = FaceIt; 94 | productName = FaceIt; 95 | productReference = 87BD02DB1CEB8CED00FEBBE1 /* FaceIt.app */; 96 | productType = "com.apple.product-type.application"; 97 | }; 98 | /* End PBXNativeTarget section */ 99 | 100 | /* Begin PBXProject section */ 101 | 87BD02D31CEB8CED00FEBBE1 /* Project object */ = { 102 | isa = PBXProject; 103 | attributes = { 104 | LastSwiftUpdateCheck = 0730; 105 | LastUpgradeCheck = 0730; 106 | ORGANIZATIONNAME = CorCoder; 107 | TargetAttributes = { 108 | 87BD02DA1CEB8CED00FEBBE1 = { 109 | CreatedOnToolsVersion = 7.3; 110 | DevelopmentTeam = 9RS3Y87D23; 111 | }; 112 | }; 113 | }; 114 | buildConfigurationList = 87BD02D61CEB8CED00FEBBE1 /* Build configuration list for PBXProject "FaceIt" */; 115 | compatibilityVersion = "Xcode 3.2"; 116 | developmentRegion = English; 117 | hasScannedForEncodings = 0; 118 | knownRegions = ( 119 | en, 120 | Base, 121 | ); 122 | mainGroup = 87BD02D21CEB8CED00FEBBE1; 123 | productRefGroup = 87BD02DC1CEB8CED00FEBBE1 /* Products */; 124 | projectDirPath = ""; 125 | projectRoot = ""; 126 | targets = ( 127 | 87BD02DA1CEB8CED00FEBBE1 /* FaceIt */, 128 | ); 129 | }; 130 | /* End PBXProject section */ 131 | 132 | /* Begin PBXResourcesBuildPhase section */ 133 | 87BD02D91CEB8CED00FEBBE1 /* Resources */ = { 134 | isa = PBXResourcesBuildPhase; 135 | buildActionMask = 2147483647; 136 | files = ( 137 | 87BD02E91CEB8CED00FEBBE1 /* LaunchScreen.storyboard in Resources */, 138 | 87BD02E61CEB8CED00FEBBE1 /* Assets.xcassets in Resources */, 139 | 87BD02E41CEB8CED00FEBBE1 /* Main.storyboard in Resources */, 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXResourcesBuildPhase section */ 144 | 145 | /* Begin PBXSourcesBuildPhase section */ 146 | 87BD02D71CEB8CED00FEBBE1 /* Sources */ = { 147 | isa = PBXSourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | 87BD02E11CEB8CED00FEBBE1 /* FaceViewController.swift in Sources */, 151 | 87BD02DF1CEB8CED00FEBBE1 /* AppDelegate.swift in Sources */, 152 | 87BD02F21CEB8E1000FEBBE1 /* FaceView.swift in Sources */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXSourcesBuildPhase section */ 157 | 158 | /* Begin PBXVariantGroup section */ 159 | 87BD02E21CEB8CED00FEBBE1 /* Main.storyboard */ = { 160 | isa = PBXVariantGroup; 161 | children = ( 162 | 87BD02E31CEB8CED00FEBBE1 /* Base */, 163 | ); 164 | name = Main.storyboard; 165 | sourceTree = ""; 166 | }; 167 | 87BD02E71CEB8CED00FEBBE1 /* LaunchScreen.storyboard */ = { 168 | isa = PBXVariantGroup; 169 | children = ( 170 | 87BD02E81CEB8CED00FEBBE1 /* Base */, 171 | ); 172 | name = LaunchScreen.storyboard; 173 | sourceTree = ""; 174 | }; 175 | /* End PBXVariantGroup section */ 176 | 177 | /* Begin XCBuildConfiguration section */ 178 | 87BD02EB1CEB8CED00FEBBE1 /* Debug */ = { 179 | isa = XCBuildConfiguration; 180 | buildSettings = { 181 | ALWAYS_SEARCH_USER_PATHS = NO; 182 | CLANG_ANALYZER_NONNULL = YES; 183 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 184 | CLANG_CXX_LIBRARY = "libc++"; 185 | CLANG_ENABLE_MODULES = YES; 186 | CLANG_ENABLE_OBJC_ARC = YES; 187 | CLANG_WARN_BOOL_CONVERSION = YES; 188 | CLANG_WARN_CONSTANT_CONVERSION = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_EMPTY_BODY = YES; 191 | CLANG_WARN_ENUM_CONVERSION = YES; 192 | CLANG_WARN_INT_CONVERSION = YES; 193 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 194 | CLANG_WARN_UNREACHABLE_CODE = YES; 195 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 196 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 197 | COPY_PHASE_STRIP = NO; 198 | DEBUG_INFORMATION_FORMAT = dwarf; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | ENABLE_TESTABILITY = YES; 201 | GCC_C_LANGUAGE_STANDARD = gnu99; 202 | GCC_DYNAMIC_NO_PIC = NO; 203 | GCC_NO_COMMON_BLOCKS = YES; 204 | GCC_OPTIMIZATION_LEVEL = 0; 205 | GCC_PREPROCESSOR_DEFINITIONS = ( 206 | "DEBUG=1", 207 | "$(inherited)", 208 | ); 209 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 210 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 211 | GCC_WARN_UNDECLARED_SELECTOR = YES; 212 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 213 | GCC_WARN_UNUSED_FUNCTION = YES; 214 | GCC_WARN_UNUSED_VARIABLE = YES; 215 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 216 | MTL_ENABLE_DEBUG_INFO = YES; 217 | ONLY_ACTIVE_ARCH = YES; 218 | SDKROOT = iphoneos; 219 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 220 | TARGETED_DEVICE_FAMILY = "1,2"; 221 | }; 222 | name = Debug; 223 | }; 224 | 87BD02EC1CEB8CED00FEBBE1 /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ALWAYS_SEARCH_USER_PATHS = NO; 228 | CLANG_ANALYZER_NONNULL = YES; 229 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 230 | CLANG_CXX_LIBRARY = "libc++"; 231 | CLANG_ENABLE_MODULES = YES; 232 | CLANG_ENABLE_OBJC_ARC = YES; 233 | CLANG_WARN_BOOL_CONVERSION = YES; 234 | CLANG_WARN_CONSTANT_CONVERSION = YES; 235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 236 | CLANG_WARN_EMPTY_BODY = YES; 237 | CLANG_WARN_ENUM_CONVERSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 240 | CLANG_WARN_UNREACHABLE_CODE = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 243 | COPY_PHASE_STRIP = NO; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | ENABLE_NS_ASSERTIONS = NO; 246 | ENABLE_STRICT_OBJC_MSGSEND = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_NO_COMMON_BLOCKS = YES; 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | SDKROOT = iphoneos; 258 | TARGETED_DEVICE_FAMILY = "1,2"; 259 | VALIDATE_PRODUCT = YES; 260 | }; 261 | name = Release; 262 | }; 263 | 87BD02EE1CEB8CED00FEBBE1 /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 267 | INFOPLIST_FILE = FaceIt/Info.plist; 268 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 269 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.FaceIt; 270 | PRODUCT_NAME = "$(TARGET_NAME)"; 271 | }; 272 | name = Debug; 273 | }; 274 | 87BD02EF1CEB8CED00FEBBE1 /* Release */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 278 | INFOPLIST_FILE = FaceIt/Info.plist; 279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 280 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.FaceIt; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | }; 283 | name = Release; 284 | }; 285 | /* End XCBuildConfiguration section */ 286 | 287 | /* Begin XCConfigurationList section */ 288 | 87BD02D61CEB8CED00FEBBE1 /* Build configuration list for PBXProject "FaceIt" */ = { 289 | isa = XCConfigurationList; 290 | buildConfigurations = ( 291 | 87BD02EB1CEB8CED00FEBBE1 /* Debug */, 292 | 87BD02EC1CEB8CED00FEBBE1 /* Release */, 293 | ); 294 | defaultConfigurationIsVisible = 0; 295 | defaultConfigurationName = Release; 296 | }; 297 | 87BD02ED1CEB8CED00FEBBE1 /* Build configuration list for PBXNativeTarget "FaceIt" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | 87BD02EE1CEB8CED00FEBBE1 /* Debug */, 301 | 87BD02EF1CEB8CED00FEBBE1 /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | }; 305 | /* End XCConfigurationList section */ 306 | }; 307 | rootObject = 87BD02D31CEB8CED00FEBBE1 /* Project object */; 308 | } 309 | -------------------------------------------------------------------------------- /calculator/calculator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8761A3251CD1079200C315E7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8761A3241CD1079200C315E7 /* AppDelegate.swift */; }; 11 | 8761A3271CD1079200C315E7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8761A3261CD1079200C315E7 /* ViewController.swift */; }; 12 | 8761A32A1CD1079200C315E7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8761A3281CD1079200C315E7 /* Main.storyboard */; }; 13 | 8761A32C1CD1079200C315E7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8761A32B1CD1079200C315E7 /* Assets.xcassets */; }; 14 | 8761A32F1CD1079200C315E7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8761A32D1CD1079200C315E7 /* LaunchScreen.storyboard */; }; 15 | 8761A33A1CD1079200C315E7 /* calculatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8761A3391CD1079200C315E7 /* calculatorTests.swift */; }; 16 | 8761A3451CD1079200C315E7 /* calculatorUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8761A3441CD1079200C315E7 /* calculatorUITests.swift */; }; 17 | 8761A3541CD2730000C315E7 /* CalculatorCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8761A3531CD2730000C315E7 /* CalculatorCore.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 8761A3361CD1079200C315E7 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 8761A3191CD1079100C315E7 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 8761A3201CD1079100C315E7; 26 | remoteInfo = calculator; 27 | }; 28 | 8761A3411CD1079200C315E7 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 8761A3191CD1079100C315E7 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 8761A3201CD1079100C315E7; 33 | remoteInfo = calculator; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 8761A3211CD1079200C315E7 /* calculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = calculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 8761A3241CD1079200C315E7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 8761A3261CD1079200C315E7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | 8761A3291CD1079200C315E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 8761A32B1CD1079200C315E7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 8761A32E1CD1079200C315E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 8761A3301CD1079200C315E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 8761A3351CD1079200C315E7 /* calculatorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = calculatorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 8761A3391CD1079200C315E7 /* calculatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = calculatorTests.swift; sourceTree = ""; }; 47 | 8761A33B1CD1079200C315E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 8761A3401CD1079200C315E7 /* calculatorUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = calculatorUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 8761A3441CD1079200C315E7 /* calculatorUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = calculatorUITests.swift; sourceTree = ""; }; 50 | 8761A3461CD1079200C315E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 8761A3531CD2730000C315E7 /* CalculatorCore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalculatorCore.swift; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 8761A31E1CD1079100C315E7 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | 8761A3321CD1079200C315E7 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | 8761A33D1CD1079200C315E7 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 8761A3181CD1079100C315E7 = { 80 | isa = PBXGroup; 81 | children = ( 82 | 8761A3231CD1079200C315E7 /* calculator */, 83 | 8761A3381CD1079200C315E7 /* calculatorTests */, 84 | 8761A3431CD1079200C315E7 /* calculatorUITests */, 85 | 8761A3221CD1079200C315E7 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | 8761A3221CD1079200C315E7 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 8761A3211CD1079200C315E7 /* calculator.app */, 93 | 8761A3351CD1079200C315E7 /* calculatorTests.xctest */, 94 | 8761A3401CD1079200C315E7 /* calculatorUITests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 8761A3231CD1079200C315E7 /* calculator */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 8761A3521CD107C400C315E7 /* Supporting files */, 103 | 8761A3261CD1079200C315E7 /* ViewController.swift */, 104 | 8761A3531CD2730000C315E7 /* CalculatorCore.swift */, 105 | 8761A3281CD1079200C315E7 /* Main.storyboard */, 106 | ); 107 | path = calculator; 108 | sourceTree = ""; 109 | }; 110 | 8761A3381CD1079200C315E7 /* calculatorTests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 8761A3391CD1079200C315E7 /* calculatorTests.swift */, 114 | 8761A33B1CD1079200C315E7 /* Info.plist */, 115 | ); 116 | path = calculatorTests; 117 | sourceTree = ""; 118 | }; 119 | 8761A3431CD1079200C315E7 /* calculatorUITests */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 8761A3441CD1079200C315E7 /* calculatorUITests.swift */, 123 | 8761A3461CD1079200C315E7 /* Info.plist */, 124 | ); 125 | path = calculatorUITests; 126 | sourceTree = ""; 127 | }; 128 | 8761A3521CD107C400C315E7 /* Supporting files */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 8761A3241CD1079200C315E7 /* AppDelegate.swift */, 132 | 8761A32B1CD1079200C315E7 /* Assets.xcassets */, 133 | 8761A32D1CD1079200C315E7 /* LaunchScreen.storyboard */, 134 | 8761A3301CD1079200C315E7 /* Info.plist */, 135 | ); 136 | name = "Supporting files"; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 8761A3201CD1079100C315E7 /* calculator */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 8761A3491CD1079200C315E7 /* Build configuration list for PBXNativeTarget "calculator" */; 145 | buildPhases = ( 146 | 8761A31D1CD1079100C315E7 /* Sources */, 147 | 8761A31E1CD1079100C315E7 /* Frameworks */, 148 | 8761A31F1CD1079100C315E7 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = calculator; 155 | productName = calculator; 156 | productReference = 8761A3211CD1079200C315E7 /* calculator.app */; 157 | productType = "com.apple.product-type.application"; 158 | }; 159 | 8761A3341CD1079200C315E7 /* calculatorTests */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 8761A34C1CD1079200C315E7 /* Build configuration list for PBXNativeTarget "calculatorTests" */; 162 | buildPhases = ( 163 | 8761A3311CD1079200C315E7 /* Sources */, 164 | 8761A3321CD1079200C315E7 /* Frameworks */, 165 | 8761A3331CD1079200C315E7 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | 8761A3371CD1079200C315E7 /* PBXTargetDependency */, 171 | ); 172 | name = calculatorTests; 173 | productName = calculatorTests; 174 | productReference = 8761A3351CD1079200C315E7 /* calculatorTests.xctest */; 175 | productType = "com.apple.product-type.bundle.unit-test"; 176 | }; 177 | 8761A33F1CD1079200C315E7 /* calculatorUITests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 8761A34F1CD1079200C315E7 /* Build configuration list for PBXNativeTarget "calculatorUITests" */; 180 | buildPhases = ( 181 | 8761A33C1CD1079200C315E7 /* Sources */, 182 | 8761A33D1CD1079200C315E7 /* Frameworks */, 183 | 8761A33E1CD1079200C315E7 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | 8761A3421CD1079200C315E7 /* PBXTargetDependency */, 189 | ); 190 | name = calculatorUITests; 191 | productName = calculatorUITests; 192 | productReference = 8761A3401CD1079200C315E7 /* calculatorUITests.xctest */; 193 | productType = "com.apple.product-type.bundle.ui-testing"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | 8761A3191CD1079100C315E7 /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastSwiftUpdateCheck = 0730; 202 | LastUpgradeCheck = 0730; 203 | ORGANIZATIONNAME = CorCoder; 204 | TargetAttributes = { 205 | 8761A3201CD1079100C315E7 = { 206 | CreatedOnToolsVersion = 7.3; 207 | DevelopmentTeam = 9RS3Y87D23; 208 | }; 209 | 8761A3341CD1079200C315E7 = { 210 | CreatedOnToolsVersion = 7.3; 211 | DevelopmentTeam = 9RS3Y87D23; 212 | TestTargetID = 8761A3201CD1079100C315E7; 213 | }; 214 | 8761A33F1CD1079200C315E7 = { 215 | CreatedOnToolsVersion = 7.3; 216 | DevelopmentTeam = 9RS3Y87D23; 217 | TestTargetID = 8761A3201CD1079100C315E7; 218 | }; 219 | }; 220 | }; 221 | buildConfigurationList = 8761A31C1CD1079100C315E7 /* Build configuration list for PBXProject "calculator" */; 222 | compatibilityVersion = "Xcode 3.2"; 223 | developmentRegion = English; 224 | hasScannedForEncodings = 0; 225 | knownRegions = ( 226 | en, 227 | Base, 228 | ); 229 | mainGroup = 8761A3181CD1079100C315E7; 230 | productRefGroup = 8761A3221CD1079200C315E7 /* Products */; 231 | projectDirPath = ""; 232 | projectRoot = ""; 233 | targets = ( 234 | 8761A3201CD1079100C315E7 /* calculator */, 235 | 8761A3341CD1079200C315E7 /* calculatorTests */, 236 | 8761A33F1CD1079200C315E7 /* calculatorUITests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | 8761A31F1CD1079100C315E7 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 8761A32F1CD1079200C315E7 /* LaunchScreen.storyboard in Resources */, 247 | 8761A32C1CD1079200C315E7 /* Assets.xcassets in Resources */, 248 | 8761A32A1CD1079200C315E7 /* Main.storyboard in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | 8761A3331CD1079200C315E7 /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | 8761A33E1CD1079200C315E7 /* Resources */ = { 260 | isa = PBXResourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXResourcesBuildPhase section */ 267 | 268 | /* Begin PBXSourcesBuildPhase section */ 269 | 8761A31D1CD1079100C315E7 /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 8761A3271CD1079200C315E7 /* ViewController.swift in Sources */, 274 | 8761A3251CD1079200C315E7 /* AppDelegate.swift in Sources */, 275 | 8761A3541CD2730000C315E7 /* CalculatorCore.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 8761A3311CD1079200C315E7 /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 8761A33A1CD1079200C315E7 /* calculatorTests.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | 8761A33C1CD1079200C315E7 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 8761A3451CD1079200C315E7 /* calculatorUITests.swift in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | /* End PBXSourcesBuildPhase section */ 296 | 297 | /* Begin PBXTargetDependency section */ 298 | 8761A3371CD1079200C315E7 /* PBXTargetDependency */ = { 299 | isa = PBXTargetDependency; 300 | target = 8761A3201CD1079100C315E7 /* calculator */; 301 | targetProxy = 8761A3361CD1079200C315E7 /* PBXContainerItemProxy */; 302 | }; 303 | 8761A3421CD1079200C315E7 /* PBXTargetDependency */ = { 304 | isa = PBXTargetDependency; 305 | target = 8761A3201CD1079100C315E7 /* calculator */; 306 | targetProxy = 8761A3411CD1079200C315E7 /* PBXContainerItemProxy */; 307 | }; 308 | /* End PBXTargetDependency section */ 309 | 310 | /* Begin PBXVariantGroup section */ 311 | 8761A3281CD1079200C315E7 /* Main.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 8761A3291CD1079200C315E7 /* Base */, 315 | ); 316 | name = Main.storyboard; 317 | sourceTree = ""; 318 | }; 319 | 8761A32D1CD1079200C315E7 /* LaunchScreen.storyboard */ = { 320 | isa = PBXVariantGroup; 321 | children = ( 322 | 8761A32E1CD1079200C315E7 /* Base */, 323 | ); 324 | name = LaunchScreen.storyboard; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXVariantGroup section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | 8761A3471CD1079200C315E7 /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_ANALYZER_NONNULL = YES; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BOOL_CONVERSION = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_EMPTY_BODY = YES; 343 | CLANG_WARN_ENUM_CONVERSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 346 | CLANG_WARN_UNREACHABLE_CODE = YES; 347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 349 | COPY_PHASE_STRIP = NO; 350 | DEBUG_INFORMATION_FORMAT = dwarf; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | ENABLE_TESTABILITY = YES; 353 | GCC_C_LANGUAGE_STANDARD = gnu99; 354 | GCC_DYNAMIC_NO_PIC = NO; 355 | GCC_NO_COMMON_BLOCKS = YES; 356 | GCC_OPTIMIZATION_LEVEL = 0; 357 | GCC_PREPROCESSOR_DEFINITIONS = ( 358 | "DEBUG=1", 359 | "$(inherited)", 360 | ); 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 368 | MTL_ENABLE_DEBUG_INFO = YES; 369 | ONLY_ACTIVE_ARCH = YES; 370 | SDKROOT = iphoneos; 371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | 8761A3481CD1079200C315E7 /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_ANALYZER_NONNULL = YES; 381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 382 | CLANG_CXX_LIBRARY = "libc++"; 383 | CLANG_ENABLE_MODULES = YES; 384 | CLANG_ENABLE_OBJC_ARC = YES; 385 | CLANG_WARN_BOOL_CONVERSION = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_EMPTY_BODY = YES; 389 | CLANG_WARN_ENUM_CONVERSION = YES; 390 | CLANG_WARN_INT_CONVERSION = YES; 391 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 392 | CLANG_WARN_UNREACHABLE_CODE = YES; 393 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 394 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 395 | COPY_PHASE_STRIP = NO; 396 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 397 | ENABLE_NS_ASSERTIONS = NO; 398 | ENABLE_STRICT_OBJC_MSGSEND = YES; 399 | GCC_C_LANGUAGE_STANDARD = gnu99; 400 | GCC_NO_COMMON_BLOCKS = YES; 401 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 402 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 403 | GCC_WARN_UNDECLARED_SELECTOR = YES; 404 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 405 | GCC_WARN_UNUSED_FUNCTION = YES; 406 | GCC_WARN_UNUSED_VARIABLE = YES; 407 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 408 | MTL_ENABLE_DEBUG_INFO = NO; 409 | SDKROOT = iphoneos; 410 | TARGETED_DEVICE_FAMILY = "1,2"; 411 | VALIDATE_PRODUCT = YES; 412 | }; 413 | name = Release; 414 | }; 415 | 8761A34A1CD1079200C315E7 /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 419 | INFOPLIST_FILE = calculator/Info.plist; 420 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 421 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.calculator; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | }; 424 | name = Debug; 425 | }; 426 | 8761A34B1CD1079200C315E7 /* Release */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 430 | INFOPLIST_FILE = calculator/Info.plist; 431 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 432 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.calculator; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | }; 435 | name = Release; 436 | }; 437 | 8761A34D1CD1079200C315E7 /* Debug */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | BUNDLE_LOADER = "$(TEST_HOST)"; 441 | INFOPLIST_FILE = calculatorTests/Info.plist; 442 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 443 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.calculatorTests; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/calculator.app/calculator"; 446 | }; 447 | name = Debug; 448 | }; 449 | 8761A34E1CD1079200C315E7 /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | BUNDLE_LOADER = "$(TEST_HOST)"; 453 | INFOPLIST_FILE = calculatorTests/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 455 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.calculatorTests; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/calculator.app/calculator"; 458 | }; 459 | name = Release; 460 | }; 461 | 8761A3501CD1079200C315E7 /* Debug */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | INFOPLIST_FILE = calculatorUITests/Info.plist; 465 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 466 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.calculatorUITests; 467 | PRODUCT_NAME = "$(TARGET_NAME)"; 468 | TEST_TARGET_NAME = calculator; 469 | }; 470 | name = Debug; 471 | }; 472 | 8761A3511CD1079200C315E7 /* Release */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | INFOPLIST_FILE = calculatorUITests/Info.plist; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 477 | PRODUCT_BUNDLE_IDENTIFIER = com.corcoder.calculatorUITests; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | TEST_TARGET_NAME = calculator; 480 | }; 481 | name = Release; 482 | }; 483 | /* End XCBuildConfiguration section */ 484 | 485 | /* Begin XCConfigurationList section */ 486 | 8761A31C1CD1079100C315E7 /* Build configuration list for PBXProject "calculator" */ = { 487 | isa = XCConfigurationList; 488 | buildConfigurations = ( 489 | 8761A3471CD1079200C315E7 /* Debug */, 490 | 8761A3481CD1079200C315E7 /* Release */, 491 | ); 492 | defaultConfigurationIsVisible = 0; 493 | defaultConfigurationName = Release; 494 | }; 495 | 8761A3491CD1079200C315E7 /* Build configuration list for PBXNativeTarget "calculator" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 8761A34A1CD1079200C315E7 /* Debug */, 499 | 8761A34B1CD1079200C315E7 /* Release */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | 8761A34C1CD1079200C315E7 /* Build configuration list for PBXNativeTarget "calculatorTests" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 8761A34D1CD1079200C315E7 /* Debug */, 508 | 8761A34E1CD1079200C315E7 /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | 8761A34F1CD1079200C315E7 /* Build configuration list for PBXNativeTarget "calculatorUITests" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 8761A3501CD1079200C315E7 /* Debug */, 517 | 8761A3511CD1079200C315E7 /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | /* End XCConfigurationList section */ 523 | }; 524 | rootObject = 8761A3191CD1079100C315E7 /* Project object */; 525 | } 526 | -------------------------------------------------------------------------------- /calculator/calculator/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 | 31 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 55 | 66 | 77 | 88 | 89 | 90 | 91 | 92 | 93 | 104 | 115 | 126 | 137 | 138 | 139 | 140 | 141 | 142 | 151 | 160 | 169 | 180 | 181 | 182 | 183 | 184 | 185 | 194 | 203 | 212 | 223 | 224 | 225 | 226 | 227 | 228 | 237 | 246 | 255 | 266 | 267 | 268 | 269 | 270 | 271 | 280 | 289 | 298 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | --------------------------------------------------------------------------------