├── screenShots ├── 1.png └── 2.png ├── Calculator ├── Calculator │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Info.plist │ ├── SceneDelegate.swift │ ├── Calculator.swift │ └── CalculatorBrain.swift └── Calculator.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── project.pbxproj ├── README.md ├── LICENSE └── .gitignore /screenShots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xIce/SwiftUICalculator/HEAD/screenShots/1.png -------------------------------------------------------------------------------- /screenShots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xIce/SwiftUICalculator/HEAD/screenShots/2.png -------------------------------------------------------------------------------- /Calculator/Calculator/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Calculator/Calculator/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Calculator/Calculator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftUICalculator 2 | 3 | A calculator app using SwiftUI which is introduced in WWDC19 4 | 5 | 6 | 7 | ## Requirements 8 | 9 | * Xcode 11 Beta 10 | * Swift 5.1 11 | * iOS 13.0 12 | -------------------------------------------------------------------------------- /Calculator/Calculator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 hotchner 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. 22 | -------------------------------------------------------------------------------- /Calculator/Calculator/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Calculator 4 | // 5 | // Created by 马红奇 on 2019/6/6. 6 | // Copyright © 2019 NSHotchner. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | func applicationWillTerminate(_ application: UIApplication) { 22 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 23 | } 24 | 25 | // MARK: UISceneSession Lifecycle 26 | 27 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 28 | // Called when a new scene session is being created. 29 | // Use this method to select a configuration to create the new scene with. 30 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 31 | } 32 | 33 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 34 | // Called when the user discards a scene session. 35 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 36 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 37 | } 38 | 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Calculator/Calculator/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UISceneConfigurationName 35 | Default Configuration 36 | UISceneDelegateClassName 37 | $(PRODUCT_MODULE_NAME).SceneDelegate 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UISupportedInterfaceOrientations~ipad 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationPortraitUpsideDown 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Calculator/Calculator/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // Calculator 4 | // 5 | // Created by 马红奇 on 2019/6/6. 6 | // Copyright © 2019 NSHotchner. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Use a UIHostingController as window root view controller 23 | let window = UIWindow(frame: UIScreen.main.bounds) 24 | window.rootViewController = UIHostingController(rootView: Calculator()) 25 | self.window = window 26 | window.makeKeyAndVisible() 27 | } 28 | 29 | func sceneDidDisconnect(_ scene: UIScene) { 30 | // Called as the scene is being released by the system. 31 | // This occurs shortly after the scene enters the background, or when its session is discarded. 32 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 33 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 34 | } 35 | 36 | func sceneDidBecomeActive(_ scene: UIScene) { 37 | // Called when the scene has moved from an inactive state to an active state. 38 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 39 | } 40 | 41 | func sceneWillResignActive(_ scene: UIScene) { 42 | // Called when the scene will move from an active state to an inactive state. 43 | // This may occur due to temporary interruptions (ex. an incoming phone call). 44 | } 45 | 46 | func sceneWillEnterForeground(_ scene: UIScene) { 47 | // Called as the scene transitions from the background to the foreground. 48 | // Use this method to undo the changes made on entering the background. 49 | } 50 | 51 | func sceneDidEnterBackground(_ scene: UIScene) { 52 | // Called as the scene transitions from the foreground to the background. 53 | // Use this method to save data, release shared resources, and store enough scene-specific state information 54 | // to restore the scene back to its current state. 55 | } 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /Calculator/Calculator/Calculator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Calculator.swift 3 | // Calculator 4 | // 5 | // Created by 马红奇 on 2019/6/6. 6 | // Copyright © 2019 NSHotchner. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | 11 | struct Calculator: View { 12 | @State private var userIsInTheMiddleOfTyping = false 13 | @State private var display = "0" 14 | @State private var brain = CalculatorBrain() 15 | 16 | let data = [["+", "−", "÷", "×"], 17 | ["π", "7", "8", "9"], 18 | ["√", "4", "5", "6"], 19 | ["cos", "1", "2", "3"], 20 | ["±", ".", "0", "="]] 21 | 22 | var body: some View { 23 | let margin: CGFloat = 10 24 | return VStack(alignment: .center) { 25 | HStack { 26 | Spacer() 27 | 28 | Text(display) 29 | .foregroundColor(Color(red: 231 / 255.0, green: 76 / 255.0, blue: 60 / 255.0)) 30 | .font(.largeTitle) 31 | .frame(height: 50) 32 | } 33 | .padding(margin) 34 | 35 | VStack(alignment: .center, spacing: margin) { 36 | ForEach(data.identified(by: \.description)) { items in 37 | HStack(alignment: .center, spacing: margin) { 38 | ForEach(items.identified(by: \.description)) { item in 39 | Text(item) 40 | .font(.title) 41 | .bold() 42 | .color(Color.blue) 43 | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) 44 | .background(Color(red: 234 / 255.0, green: 240 / 255.0, blue: 241 / 255.0)) 45 | .tapAction { 46 | self.touchAction(item) 47 | } 48 | } 49 | } 50 | } 51 | } 52 | .padding(EdgeInsets(top: 0, leading: margin, bottom: 0, trailing: margin)) 53 | } 54 | .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) 55 | } 56 | 57 | private func touchAction(_ symbol: String) { 58 | if Int(symbol) != nil || symbol == "." { 59 | touchDigit(symbol) 60 | } else { 61 | performOperation(symbol) 62 | } 63 | } 64 | 65 | private func touchDigit(_ digit: String) { 66 | print(#function) 67 | if userIsInTheMiddleOfTyping { 68 | display += digit 69 | } else { 70 | display = digit 71 | userIsInTheMiddleOfTyping = true 72 | } 73 | } 74 | 75 | private func performOperation(_ symbol: String) { 76 | print(#function) 77 | if userIsInTheMiddleOfTyping { 78 | brain.setOperand(Double(display)!) 79 | userIsInTheMiddleOfTyping = false 80 | } 81 | 82 | brain.performOperation(symbol) 83 | 84 | if let result = brain.result { 85 | display = String(result) 86 | } 87 | } 88 | } 89 | 90 | #if DEBUG 91 | struct Calculator_Previews : PreviewProvider { 92 | static var previews: some View { 93 | Calculator() 94 | } 95 | } 96 | #endif 97 | -------------------------------------------------------------------------------- /Calculator/Calculator/CalculatorBrain.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CalculatorBrain.swift 3 | // Calculator 4 | // 5 | // Created by 马红奇 on 2019/6/6. 6 | // Copyright © 2019 NSHotchner. All rights reserved. 7 | // from class 8 | 9 | import Foundation 10 | 11 | struct CalculatorBrain { 12 | 13 | // optional on initialization = not set 14 | private var accumulator: Double? 15 | 16 | // private enum specifying operation types 17 | // with an associated value 18 | private enum Operation { 19 | case constant(Double) 20 | case unary((Double) -> Double) 21 | case binary((Double,Double) -> Double) 22 | case equals 23 | } 24 | 25 | // private extensible dictionary of operations with closures 26 | private var operations: Dictionary = [ 27 | "π" : Operation.constant(Double.pi), 28 | "e" : Operation.constant(M_E), 29 | "√" : Operation.unary(sqrt), 30 | "cos" : Operation.unary(cos), 31 | "±" : Operation.unary({ -$0 }), 32 | "×" : Operation.binary({ $0 * $1 }), 33 | "÷" : Operation.binary({ $0 / $1 }), 34 | "+" : Operation.binary({ $0 + $1 }), 35 | "−" : Operation.binary({ $0 - $1 }), 36 | "=" : Operation.equals 37 | ] 38 | 39 | mutating func performOperation(_ symbol: String) { 40 | if let operation = operations[symbol] { 41 | switch operation { 42 | case .constant(let value): 43 | accumulator = value 44 | case .unary(let f): 45 | if accumulator != nil { 46 | accumulator = f(accumulator!) 47 | } 48 | case .binary(let f): 49 | if accumulator != nil { 50 | pendingBinaryOperation = PendingBinaryOperation(function: f, firstOperand: accumulator!) 51 | accumulator = nil 52 | } 53 | case .equals: 54 | performPendingBinaryOperation() 55 | } 56 | } else { 57 | print("wrong operation symbol") 58 | } 59 | } 60 | 61 | // Private mutating func for performing pending binary operations 62 | mutating func performPendingBinaryOperation() { 63 | if pendingBinaryOperation != nil && accumulator != nil { 64 | accumulator = pendingBinaryOperation!.perform(with: accumulator!) 65 | pendingBinaryOperation = nil 66 | } 67 | } 68 | 69 | // Private optional Pending Binary Operation 70 | private var pendingBinaryOperation: PendingBinaryOperation? 71 | 72 | // embedded private struct to support binary operations 73 | // with a constant function and pending first operand 74 | // doesn't need mutating since its just returning a value 75 | private struct PendingBinaryOperation { 76 | let function: (Double, Double) -> Double 77 | let firstOperand: Double 78 | 79 | func perform(with secondOperand: Double) -> Double { 80 | return function(firstOperand, secondOperand) 81 | } 82 | } 83 | 84 | // mark method as mutating in order to assign to property 85 | mutating func setOperand(_ operand: Double) { 86 | accumulator = operand 87 | } 88 | 89 | // return an optional since the accumulator can be not set 90 | var result: Double? { 91 | get { 92 | return accumulator 93 | } 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /Calculator/Calculator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FB5DD72922A8D8D000642035 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB5DD72822A8D8D000642035 /* AppDelegate.swift */; }; 11 | FB5DD72B22A8D8D000642035 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB5DD72A22A8D8D000642035 /* SceneDelegate.swift */; }; 12 | FB5DD72D22A8D8D000642035 /* Calculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB5DD72C22A8D8D000642035 /* Calculator.swift */; }; 13 | FB5DD72F22A8D8D100642035 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FB5DD72E22A8D8D100642035 /* Assets.xcassets */; }; 14 | FB5DD73222A8D8D100642035 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FB5DD73122A8D8D100642035 /* Preview Assets.xcassets */; }; 15 | FB5DD73522A8D8D100642035 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB5DD73322A8D8D100642035 /* LaunchScreen.storyboard */; }; 16 | FB5DD73D22A8D9C800642035 /* CalculatorBrain.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB5DD73C22A8D9C800642035 /* CalculatorBrain.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | FB5DD72522A8D8D000642035 /* Calculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Calculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | FB5DD72822A8D8D000642035 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | FB5DD72A22A8D8D000642035 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 23 | FB5DD72C22A8D8D000642035 /* Calculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Calculator.swift; sourceTree = ""; }; 24 | FB5DD72E22A8D8D100642035 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | FB5DD73122A8D8D100642035 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 26 | FB5DD73422A8D8D100642035 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | FB5DD73622A8D8D100642035 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | FB5DD73C22A8D9C800642035 /* CalculatorBrain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculatorBrain.swift; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | FB5DD72222A8D8D000642035 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | FB5DD71C22A8D8D000642035 = { 43 | isa = PBXGroup; 44 | children = ( 45 | FB5DD72722A8D8D000642035 /* Calculator */, 46 | FB5DD72622A8D8D000642035 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | FB5DD72622A8D8D000642035 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | FB5DD72522A8D8D000642035 /* Calculator.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | FB5DD72722A8D8D000642035 /* Calculator */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | FB5DD72822A8D8D000642035 /* AppDelegate.swift */, 62 | FB5DD72A22A8D8D000642035 /* SceneDelegate.swift */, 63 | FB5DD72C22A8D8D000642035 /* Calculator.swift */, 64 | FB5DD73C22A8D9C800642035 /* CalculatorBrain.swift */, 65 | FB5DD72E22A8D8D100642035 /* Assets.xcassets */, 66 | FB5DD73322A8D8D100642035 /* LaunchScreen.storyboard */, 67 | FB5DD73622A8D8D100642035 /* Info.plist */, 68 | FB5DD73022A8D8D100642035 /* Preview Content */, 69 | ); 70 | path = Calculator; 71 | sourceTree = ""; 72 | }; 73 | FB5DD73022A8D8D100642035 /* Preview Content */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | FB5DD73122A8D8D100642035 /* Preview Assets.xcassets */, 77 | ); 78 | path = "Preview Content"; 79 | sourceTree = ""; 80 | }; 81 | /* End PBXGroup section */ 82 | 83 | /* Begin PBXNativeTarget section */ 84 | FB5DD72422A8D8D000642035 /* Calculator */ = { 85 | isa = PBXNativeTarget; 86 | buildConfigurationList = FB5DD73922A8D8D100642035 /* Build configuration list for PBXNativeTarget "Calculator" */; 87 | buildPhases = ( 88 | FB5DD72122A8D8D000642035 /* Sources */, 89 | FB5DD72222A8D8D000642035 /* Frameworks */, 90 | FB5DD72322A8D8D000642035 /* Resources */, 91 | ); 92 | buildRules = ( 93 | ); 94 | dependencies = ( 95 | ); 96 | name = Calculator; 97 | productName = Calculator; 98 | productReference = FB5DD72522A8D8D000642035 /* Calculator.app */; 99 | productType = "com.apple.product-type.application"; 100 | }; 101 | /* End PBXNativeTarget section */ 102 | 103 | /* Begin PBXProject section */ 104 | FB5DD71D22A8D8D000642035 /* Project object */ = { 105 | isa = PBXProject; 106 | attributes = { 107 | LastSwiftUpdateCheck = 1100; 108 | LastUpgradeCheck = 1100; 109 | ORGANIZATIONNAME = NSHotchner; 110 | TargetAttributes = { 111 | FB5DD72422A8D8D000642035 = { 112 | CreatedOnToolsVersion = 11.0; 113 | }; 114 | }; 115 | }; 116 | buildConfigurationList = FB5DD72022A8D8D000642035 /* Build configuration list for PBXProject "Calculator" */; 117 | compatibilityVersion = "Xcode 9.3"; 118 | developmentRegion = en; 119 | hasScannedForEncodings = 0; 120 | knownRegions = ( 121 | en, 122 | Base, 123 | ); 124 | mainGroup = FB5DD71C22A8D8D000642035; 125 | productRefGroup = FB5DD72622A8D8D000642035 /* Products */; 126 | projectDirPath = ""; 127 | projectRoot = ""; 128 | targets = ( 129 | FB5DD72422A8D8D000642035 /* Calculator */, 130 | ); 131 | }; 132 | /* End PBXProject section */ 133 | 134 | /* Begin PBXResourcesBuildPhase section */ 135 | FB5DD72322A8D8D000642035 /* Resources */ = { 136 | isa = PBXResourcesBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | FB5DD73522A8D8D100642035 /* LaunchScreen.storyboard in Resources */, 140 | FB5DD73222A8D8D100642035 /* Preview Assets.xcassets in Resources */, 141 | FB5DD72F22A8D8D100642035 /* Assets.xcassets in Resources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXResourcesBuildPhase section */ 146 | 147 | /* Begin PBXSourcesBuildPhase section */ 148 | FB5DD72122A8D8D000642035 /* Sources */ = { 149 | isa = PBXSourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | FB5DD72922A8D8D000642035 /* AppDelegate.swift in Sources */, 153 | FB5DD72B22A8D8D000642035 /* SceneDelegate.swift in Sources */, 154 | FB5DD73D22A8D9C800642035 /* CalculatorBrain.swift in Sources */, 155 | FB5DD72D22A8D8D000642035 /* Calculator.swift in Sources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXSourcesBuildPhase section */ 160 | 161 | /* Begin PBXVariantGroup section */ 162 | FB5DD73322A8D8D100642035 /* LaunchScreen.storyboard */ = { 163 | isa = PBXVariantGroup; 164 | children = ( 165 | FB5DD73422A8D8D100642035 /* Base */, 166 | ); 167 | name = LaunchScreen.storyboard; 168 | sourceTree = ""; 169 | }; 170 | /* End PBXVariantGroup section */ 171 | 172 | /* Begin XCBuildConfiguration section */ 173 | FB5DD73722A8D8D100642035 /* Debug */ = { 174 | isa = XCBuildConfiguration; 175 | buildSettings = { 176 | ALWAYS_SEARCH_USER_PATHS = NO; 177 | CLANG_ANALYZER_NONNULL = YES; 178 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 179 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 180 | CLANG_CXX_LIBRARY = "libc++"; 181 | CLANG_ENABLE_MODULES = YES; 182 | CLANG_ENABLE_OBJC_ARC = YES; 183 | CLANG_ENABLE_OBJC_WEAK = YES; 184 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 185 | CLANG_WARN_BOOL_CONVERSION = YES; 186 | CLANG_WARN_COMMA = YES; 187 | CLANG_WARN_CONSTANT_CONVERSION = YES; 188 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INFINITE_RECURSION = YES; 194 | CLANG_WARN_INT_CONVERSION = YES; 195 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 196 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 197 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 198 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 199 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 200 | CLANG_WARN_STRICT_PROTOTYPES = YES; 201 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 202 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 203 | CLANG_WARN_UNREACHABLE_CODE = YES; 204 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 205 | COPY_PHASE_STRIP = NO; 206 | DEBUG_INFORMATION_FORMAT = dwarf; 207 | ENABLE_STRICT_OBJC_MSGSEND = YES; 208 | ENABLE_TESTABILITY = YES; 209 | GCC_C_LANGUAGE_STANDARD = gnu11; 210 | GCC_DYNAMIC_NO_PIC = NO; 211 | GCC_NO_COMMON_BLOCKS = YES; 212 | GCC_OPTIMIZATION_LEVEL = 0; 213 | GCC_PREPROCESSOR_DEFINITIONS = ( 214 | "DEBUG=1", 215 | "$(inherited)", 216 | ); 217 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 218 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 219 | GCC_WARN_UNDECLARED_SELECTOR = YES; 220 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 221 | GCC_WARN_UNUSED_FUNCTION = YES; 222 | GCC_WARN_UNUSED_VARIABLE = YES; 223 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 224 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 225 | MTL_FAST_MATH = YES; 226 | ONLY_ACTIVE_ARCH = YES; 227 | SDKROOT = iphoneos; 228 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 229 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 230 | }; 231 | name = Debug; 232 | }; 233 | FB5DD73822A8D8D100642035 /* Release */ = { 234 | isa = XCBuildConfiguration; 235 | buildSettings = { 236 | ALWAYS_SEARCH_USER_PATHS = NO; 237 | CLANG_ANALYZER_NONNULL = YES; 238 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_ENABLE_OBJC_WEAK = YES; 244 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 245 | CLANG_WARN_BOOL_CONVERSION = YES; 246 | CLANG_WARN_COMMA = YES; 247 | CLANG_WARN_CONSTANT_CONVERSION = YES; 248 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 250 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INFINITE_RECURSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 257 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 258 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 259 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 260 | CLANG_WARN_STRICT_PROTOTYPES = YES; 261 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 262 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 263 | CLANG_WARN_UNREACHABLE_CODE = YES; 264 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 265 | COPY_PHASE_STRIP = NO; 266 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 267 | ENABLE_NS_ASSERTIONS = NO; 268 | ENABLE_STRICT_OBJC_MSGSEND = YES; 269 | GCC_C_LANGUAGE_STANDARD = gnu11; 270 | GCC_NO_COMMON_BLOCKS = YES; 271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 273 | GCC_WARN_UNDECLARED_SELECTOR = YES; 274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 275 | GCC_WARN_UNUSED_FUNCTION = YES; 276 | GCC_WARN_UNUSED_VARIABLE = YES; 277 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 278 | MTL_ENABLE_DEBUG_INFO = NO; 279 | MTL_FAST_MATH = YES; 280 | SDKROOT = iphoneos; 281 | SWIFT_COMPILATION_MODE = wholemodule; 282 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 283 | VALIDATE_PRODUCT = YES; 284 | }; 285 | name = Release; 286 | }; 287 | FB5DD73A22A8D8D100642035 /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | CODE_SIGN_STYLE = Automatic; 292 | DEVELOPMENT_ASSET_PATHS = "Calculator/Preview\\ Content"; 293 | ENABLE_PREVIEWS = YES; 294 | INFOPLIST_FILE = Calculator/Info.plist; 295 | LD_RUNPATH_SEARCH_PATHS = ( 296 | "$(inherited)", 297 | "@executable_path/Frameworks", 298 | ); 299 | PRODUCT_BUNDLE_IDENTIFIER = hotchner.tk.Calculator; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | SWIFT_VERSION = 5.0; 302 | TARGETED_DEVICE_FAMILY = "1,2"; 303 | }; 304 | name = Debug; 305 | }; 306 | FB5DD73B22A8D8D100642035 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CODE_SIGN_STYLE = Automatic; 311 | DEVELOPMENT_ASSET_PATHS = "Calculator/Preview\\ Content"; 312 | ENABLE_PREVIEWS = YES; 313 | INFOPLIST_FILE = Calculator/Info.plist; 314 | LD_RUNPATH_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | "@executable_path/Frameworks", 317 | ); 318 | PRODUCT_BUNDLE_IDENTIFIER = hotchner.tk.Calculator; 319 | PRODUCT_NAME = "$(TARGET_NAME)"; 320 | SWIFT_VERSION = 5.0; 321 | TARGETED_DEVICE_FAMILY = "1,2"; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | FB5DD72022A8D8D000642035 /* Build configuration list for PBXProject "Calculator" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | FB5DD73722A8D8D100642035 /* Debug */, 332 | FB5DD73822A8D8D100642035 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | FB5DD73922A8D8D100642035 /* Build configuration list for PBXNativeTarget "Calculator" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | FB5DD73A22A8D8D100642035 /* Debug */, 341 | FB5DD73B22A8D8D100642035 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = FB5DD71D22A8D8D000642035 /* Project object */; 349 | } 350 | --------------------------------------------------------------------------------