├── .DS_Store ├── AppDelegate.swift ├── Assets.xcassets ├── 0.imageset │ ├── 0.png │ └── Contents.json ├── 1.imageset │ ├── 1.png │ └── Contents.json ├── 2.imageset │ ├── 2.png │ └── Contents.json ├── 3.imageset │ ├── 3.png │ └── Contents.json ├── 4.imageset │ ├── 4.png │ └── Contents.json ├── 5.imageset │ ├── 5.png │ └── Contents.json ├── 6.imageset │ ├── 6.png │ └── Contents.json ├── 7.imageset │ ├── 7.png │ └── Contents.json ├── 8.imageset │ ├── 8.png │ └── Contents.json ├── 9.imageset │ ├── 9.png │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json ├── Retro-Calc.imageset │ ├── Contents.json │ └── Retro-Calc.png ├── add.imageset │ ├── Contents.json │ └── add.png ├── backpanel.imageset │ ├── Contents.json │ └── backpanel.png ├── clear.imageset │ ├── Contents.json │ └── clear.png ├── counter.imageset │ ├── Contents.json │ └── counter.png ├── divide.imageset │ ├── Contents.json │ └── divide.png ├── equal.imageset │ ├── Contents.json │ └── equal.png ├── ground.imageset │ ├── Contents.json │ └── ground.png ├── launchbg.imageset │ ├── Contents.json │ └── launchbg.png ├── launchground.imageset │ ├── Contents.json │ └── launchground.png ├── multiply.imageset │ ├── Contents.json │ └── multiply.png ├── robot.imageset │ ├── Contents.json │ └── robot.png ├── space-bg.imageset │ ├── Contents.json │ └── space-bg.png └── subtract.imageset │ ├── Contents.json │ └── subtract.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Minecraft.ttf ├── README.md ├── RetroCalculator.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── forrestknight.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── forrestknight.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── RetroCalculator.xcscheme │ └── xcschememanagement.plist ├── ViewController.swift └── btn.wav /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/.DS_Store -------------------------------------------------------------------------------- /AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // RetroCalculator 4 | // 5 | // Created by Forrest Knight on 11/8/16. 6 | // Copyright © 2016 Forrest Knight. 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: [UIApplicationLaunchOptionsKey: Any]?) -> 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 invalidate graphics rendering callbacks. 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 active 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 | -------------------------------------------------------------------------------- /Assets.xcassets/0.imageset/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/0.imageset/0.png -------------------------------------------------------------------------------- /Assets.xcassets/0.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "0.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/1.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/1.imageset/1.png -------------------------------------------------------------------------------- /Assets.xcassets/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/2.imageset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/2.imageset/2.png -------------------------------------------------------------------------------- /Assets.xcassets/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/3.imageset/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/3.imageset/3.png -------------------------------------------------------------------------------- /Assets.xcassets/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/4.imageset/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/4.imageset/4.png -------------------------------------------------------------------------------- /Assets.xcassets/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/5.imageset/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/5.imageset/5.png -------------------------------------------------------------------------------- /Assets.xcassets/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "5.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/6.imageset/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/6.imageset/6.png -------------------------------------------------------------------------------- /Assets.xcassets/6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "6.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/7.imageset/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/7.imageset/7.png -------------------------------------------------------------------------------- /Assets.xcassets/7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "7.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/8.imageset/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/8.imageset/8.png -------------------------------------------------------------------------------- /Assets.xcassets/8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "8.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/9.imageset/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/9.imageset/9.png -------------------------------------------------------------------------------- /Assets.xcassets/9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "9.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /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 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Assets.xcassets/Retro-Calc.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Retro-Calc.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/Retro-Calc.imageset/Retro-Calc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/Retro-Calc.imageset/Retro-Calc.png -------------------------------------------------------------------------------- /Assets.xcassets/add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "add.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/add.imageset/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/add.imageset/add.png -------------------------------------------------------------------------------- /Assets.xcassets/backpanel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "backpanel.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/backpanel.imageset/backpanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/backpanel.imageset/backpanel.png -------------------------------------------------------------------------------- /Assets.xcassets/clear.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "clear.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/clear.imageset/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/clear.imageset/clear.png -------------------------------------------------------------------------------- /Assets.xcassets/counter.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "counter.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/counter.imageset/counter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/counter.imageset/counter.png -------------------------------------------------------------------------------- /Assets.xcassets/divide.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "divide.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/divide.imageset/divide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/divide.imageset/divide.png -------------------------------------------------------------------------------- /Assets.xcassets/equal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "equal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/equal.imageset/equal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/equal.imageset/equal.png -------------------------------------------------------------------------------- /Assets.xcassets/ground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ground.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/ground.imageset/ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/ground.imageset/ground.png -------------------------------------------------------------------------------- /Assets.xcassets/launchbg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "launchbg.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/launchbg.imageset/launchbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/launchbg.imageset/launchbg.png -------------------------------------------------------------------------------- /Assets.xcassets/launchground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "launchground.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/launchground.imageset/launchground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/launchground.imageset/launchground.png -------------------------------------------------------------------------------- /Assets.xcassets/multiply.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "multiply.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/multiply.imageset/multiply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/multiply.imageset/multiply.png -------------------------------------------------------------------------------- /Assets.xcassets/robot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "robot.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/robot.imageset/robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/robot.imageset/robot.png -------------------------------------------------------------------------------- /Assets.xcassets/space-bg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "space-bg.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/space-bg.imageset/space-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/space-bg.imageset/space-bg.png -------------------------------------------------------------------------------- /Assets.xcassets/subtract.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "subtract.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Assets.xcassets/subtract.imageset/subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Assets.xcassets/subtract.imageset/subtract.png -------------------------------------------------------------------------------- /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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Minecraft 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 | 41 | 42 | 43 | 44 | 53 | 54 | 55 | 56 | 57 | 67 | 77 | 87 | 88 | 89 | 90 | 91 | 101 | 111 | 121 | 122 | 123 | 124 | 125 | 135 | 145 | 155 | 156 | 157 | 158 | 159 | 169 | 179 | 189 | 190 | 191 | 192 | 193 | 203 | 213 | 223 | 224 | 225 | 226 | 227 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | -------------------------------------------------------------------------------- /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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIAppFonts 24 | 25 | Minecraft.ttf 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Minecraft.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/Minecraft.ttf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RetroCalculator 2 | 3 | This is a retro-themed simple calculator iOS application. 4 | 5 | # What I Learned 6 | 7 | * Write simple math operations with Swift 8 | * Integrate UIButtons and sounds 9 | * Design a UI using image assets with UIStackView 10 | * Practice using IBActions and IBOutlets 11 | -------------------------------------------------------------------------------- /RetroCalculator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5ED3E7421DD2A02D008BAC39 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ED3E7411DD2A02D008BAC39 /* AppDelegate.swift */; }; 11 | 5ED3E7441DD2A02D008BAC39 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ED3E7431DD2A02D008BAC39 /* ViewController.swift */; }; 12 | 5ED3E7471DD2A02D008BAC39 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5ED3E7451DD2A02D008BAC39 /* Main.storyboard */; }; 13 | 5ED3E7491DD2A02D008BAC39 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5ED3E7481DD2A02D008BAC39 /* Assets.xcassets */; }; 14 | 5ED3E74C1DD2A02D008BAC39 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5ED3E74A1DD2A02D008BAC39 /* LaunchScreen.storyboard */; }; 15 | 5ED3E7541DD2B6E0008BAC39 /* Minecraft.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5ED3E7531DD2B6E0008BAC39 /* Minecraft.ttf */; }; 16 | 5ED3E7561DD2B94C008BAC39 /* btn.wav in Resources */ = {isa = PBXBuildFile; fileRef = 5ED3E7551DD2B94C008BAC39 /* btn.wav */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 5ED3E73E1DD2A02D008BAC39 /* RetroCalculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroCalculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 5ED3E7411DD2A02D008BAC39 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 5ED3E7431DD2A02D008BAC39 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | 5ED3E7461DD2A02D008BAC39 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | 5ED3E7481DD2A02D008BAC39 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 5ED3E74B1DD2A02D008BAC39 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | 5ED3E74D1DD2A02D008BAC39 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 5ED3E7531DD2B6E0008BAC39 /* Minecraft.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Minecraft.ttf; sourceTree = ""; }; 28 | 5ED3E7551DD2B94C008BAC39 /* btn.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = btn.wav; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 5ED3E73B1DD2A02C008BAC39 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 5ED3E7351DD2A02C008BAC39 = { 43 | isa = PBXGroup; 44 | children = ( 45 | 5ED3E7401DD2A02D008BAC39 /* RetroCalculator */, 46 | 5ED3E73F1DD2A02D008BAC39 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 5ED3E73F1DD2A02D008BAC39 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 5ED3E73E1DD2A02D008BAC39 /* RetroCalculator.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 5ED3E7401DD2A02D008BAC39 /* RetroCalculator */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 5ED3E7531DD2B6E0008BAC39 /* Minecraft.ttf */, 62 | 5ED3E7551DD2B94C008BAC39 /* btn.wav */, 63 | 5ED3E7411DD2A02D008BAC39 /* AppDelegate.swift */, 64 | 5ED3E7431DD2A02D008BAC39 /* ViewController.swift */, 65 | 5ED3E7451DD2A02D008BAC39 /* Main.storyboard */, 66 | 5ED3E7481DD2A02D008BAC39 /* Assets.xcassets */, 67 | 5ED3E74A1DD2A02D008BAC39 /* LaunchScreen.storyboard */, 68 | 5ED3E74D1DD2A02D008BAC39 /* Info.plist */, 69 | ); 70 | path = RetroCalculator; 71 | sourceTree = ""; 72 | }; 73 | /* End PBXGroup section */ 74 | 75 | /* Begin PBXNativeTarget section */ 76 | 5ED3E73D1DD2A02C008BAC39 /* RetroCalculator */ = { 77 | isa = PBXNativeTarget; 78 | buildConfigurationList = 5ED3E7501DD2A02D008BAC39 /* Build configuration list for PBXNativeTarget "RetroCalculator" */; 79 | buildPhases = ( 80 | 5ED3E73A1DD2A02C008BAC39 /* Sources */, 81 | 5ED3E73B1DD2A02C008BAC39 /* Frameworks */, 82 | 5ED3E73C1DD2A02C008BAC39 /* Resources */, 83 | ); 84 | buildRules = ( 85 | ); 86 | dependencies = ( 87 | ); 88 | name = RetroCalculator; 89 | productName = RetroCalculator; 90 | productReference = 5ED3E73E1DD2A02D008BAC39 /* RetroCalculator.app */; 91 | productType = "com.apple.product-type.application"; 92 | }; 93 | /* End PBXNativeTarget section */ 94 | 95 | /* Begin PBXProject section */ 96 | 5ED3E7361DD2A02C008BAC39 /* Project object */ = { 97 | isa = PBXProject; 98 | attributes = { 99 | LastSwiftUpdateCheck = 0800; 100 | LastUpgradeCheck = 0800; 101 | ORGANIZATIONNAME = "Forrest Knight"; 102 | TargetAttributes = { 103 | 5ED3E73D1DD2A02C008BAC39 = { 104 | CreatedOnToolsVersion = 8.0; 105 | DevelopmentTeam = RPX5FXH8WZ; 106 | ProvisioningStyle = Automatic; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = 5ED3E7391DD2A02C008BAC39 /* Build configuration list for PBXProject "RetroCalculator" */; 111 | compatibilityVersion = "Xcode 3.2"; 112 | developmentRegion = English; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | Base, 117 | ); 118 | mainGroup = 5ED3E7351DD2A02C008BAC39; 119 | productRefGroup = 5ED3E73F1DD2A02D008BAC39 /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | 5ED3E73D1DD2A02C008BAC39 /* RetroCalculator */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | 5ED3E73C1DD2A02C008BAC39 /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | 5ED3E7561DD2B94C008BAC39 /* btn.wav in Resources */, 134 | 5ED3E74C1DD2A02D008BAC39 /* LaunchScreen.storyboard in Resources */, 135 | 5ED3E7491DD2A02D008BAC39 /* Assets.xcassets in Resources */, 136 | 5ED3E7541DD2B6E0008BAC39 /* Minecraft.ttf in Resources */, 137 | 5ED3E7471DD2A02D008BAC39 /* Main.storyboard in Resources */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXResourcesBuildPhase section */ 142 | 143 | /* Begin PBXSourcesBuildPhase section */ 144 | 5ED3E73A1DD2A02C008BAC39 /* Sources */ = { 145 | isa = PBXSourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | 5ED3E7441DD2A02D008BAC39 /* ViewController.swift in Sources */, 149 | 5ED3E7421DD2A02D008BAC39 /* AppDelegate.swift in Sources */, 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXSourcesBuildPhase section */ 154 | 155 | /* Begin PBXVariantGroup section */ 156 | 5ED3E7451DD2A02D008BAC39 /* Main.storyboard */ = { 157 | isa = PBXVariantGroup; 158 | children = ( 159 | 5ED3E7461DD2A02D008BAC39 /* Base */, 160 | ); 161 | name = Main.storyboard; 162 | sourceTree = ""; 163 | }; 164 | 5ED3E74A1DD2A02D008BAC39 /* LaunchScreen.storyboard */ = { 165 | isa = PBXVariantGroup; 166 | children = ( 167 | 5ED3E74B1DD2A02D008BAC39 /* Base */, 168 | ); 169 | name = LaunchScreen.storyboard; 170 | sourceTree = ""; 171 | }; 172 | /* End PBXVariantGroup section */ 173 | 174 | /* Begin XCBuildConfiguration section */ 175 | 5ED3E74E1DD2A02D008BAC39 /* Debug */ = { 176 | isa = XCBuildConfiguration; 177 | buildSettings = { 178 | ALWAYS_SEARCH_USER_PATHS = NO; 179 | CLANG_ANALYZER_NONNULL = YES; 180 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 181 | CLANG_CXX_LIBRARY = "libc++"; 182 | CLANG_ENABLE_MODULES = YES; 183 | CLANG_ENABLE_OBJC_ARC = YES; 184 | CLANG_WARN_BOOL_CONVERSION = YES; 185 | CLANG_WARN_CONSTANT_CONVERSION = YES; 186 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 187 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 188 | CLANG_WARN_EMPTY_BODY = YES; 189 | CLANG_WARN_ENUM_CONVERSION = YES; 190 | CLANG_WARN_INFINITE_RECURSION = YES; 191 | CLANG_WARN_INT_CONVERSION = YES; 192 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 193 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 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 = 10.0; 216 | MTL_ENABLE_DEBUG_INFO = YES; 217 | ONLY_ACTIVE_ARCH = YES; 218 | SDKROOT = iphoneos; 219 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 220 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 221 | TARGETED_DEVICE_FAMILY = "1,2"; 222 | }; 223 | name = Debug; 224 | }; 225 | 5ED3E74F1DD2A02D008BAC39 /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | CLANG_ANALYZER_NONNULL = YES; 230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 231 | CLANG_CXX_LIBRARY = "libc++"; 232 | CLANG_ENABLE_MODULES = YES; 233 | CLANG_ENABLE_OBJC_ARC = YES; 234 | CLANG_WARN_BOOL_CONVERSION = YES; 235 | CLANG_WARN_CONSTANT_CONVERSION = YES; 236 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 237 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 238 | CLANG_WARN_EMPTY_BODY = YES; 239 | CLANG_WARN_ENUM_CONVERSION = YES; 240 | CLANG_WARN_INFINITE_RECURSION = YES; 241 | CLANG_WARN_INT_CONVERSION = YES; 242 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 243 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 244 | CLANG_WARN_UNREACHABLE_CODE = YES; 245 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 246 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 247 | COPY_PHASE_STRIP = NO; 248 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 249 | ENABLE_NS_ASSERTIONS = NO; 250 | ENABLE_STRICT_OBJC_MSGSEND = YES; 251 | GCC_C_LANGUAGE_STANDARD = gnu99; 252 | GCC_NO_COMMON_BLOCKS = YES; 253 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 254 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 255 | GCC_WARN_UNDECLARED_SELECTOR = YES; 256 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 257 | GCC_WARN_UNUSED_FUNCTION = YES; 258 | GCC_WARN_UNUSED_VARIABLE = YES; 259 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 260 | MTL_ENABLE_DEBUG_INFO = NO; 261 | SDKROOT = iphoneos; 262 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 263 | TARGETED_DEVICE_FAMILY = "1,2"; 264 | VALIDATE_PRODUCT = YES; 265 | }; 266 | name = Release; 267 | }; 268 | 5ED3E7511DD2A02D008BAC39 /* Debug */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 272 | DEVELOPMENT_TEAM = RPX5FXH8WZ; 273 | INFOPLIST_FILE = RetroCalculator/Info.plist; 274 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 275 | PRODUCT_BUNDLE_IDENTIFIER = com.ForrestKnight.RetroCalculator; 276 | PRODUCT_NAME = "$(TARGET_NAME)"; 277 | SWIFT_VERSION = 3.0; 278 | }; 279 | name = Debug; 280 | }; 281 | 5ED3E7521DD2A02D008BAC39 /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 285 | DEVELOPMENT_TEAM = RPX5FXH8WZ; 286 | INFOPLIST_FILE = RetroCalculator/Info.plist; 287 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 288 | PRODUCT_BUNDLE_IDENTIFIER = com.ForrestKnight.RetroCalculator; 289 | PRODUCT_NAME = "$(TARGET_NAME)"; 290 | SWIFT_VERSION = 3.0; 291 | }; 292 | name = Release; 293 | }; 294 | /* End XCBuildConfiguration section */ 295 | 296 | /* Begin XCConfigurationList section */ 297 | 5ED3E7391DD2A02C008BAC39 /* Build configuration list for PBXProject "RetroCalculator" */ = { 298 | isa = XCConfigurationList; 299 | buildConfigurations = ( 300 | 5ED3E74E1DD2A02D008BAC39 /* Debug */, 301 | 5ED3E74F1DD2A02D008BAC39 /* Release */, 302 | ); 303 | defaultConfigurationIsVisible = 0; 304 | defaultConfigurationName = Release; 305 | }; 306 | 5ED3E7501DD2A02D008BAC39 /* Build configuration list for PBXNativeTarget "RetroCalculator" */ = { 307 | isa = XCConfigurationList; 308 | buildConfigurations = ( 309 | 5ED3E7511DD2A02D008BAC39 /* Debug */, 310 | 5ED3E7521DD2A02D008BAC39 /* Release */, 311 | ); 312 | defaultConfigurationIsVisible = 0; 313 | defaultConfigurationName = Release; 314 | }; 315 | /* End XCConfigurationList section */ 316 | }; 317 | rootObject = 5ED3E7361DD2A02C008BAC39 /* Project object */; 318 | } 319 | -------------------------------------------------------------------------------- /RetroCalculator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RetroCalculator.xcodeproj/project.xcworkspace/xcuserdata/forrestknight.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/RetroCalculator.xcodeproj/project.xcworkspace/xcuserdata/forrestknight.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /RetroCalculator.xcodeproj/xcuserdata/forrestknight.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /RetroCalculator.xcodeproj/xcuserdata/forrestknight.xcuserdatad/xcschemes/RetroCalculator.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 | -------------------------------------------------------------------------------- /RetroCalculator.xcodeproj/xcuserdata/forrestknight.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RetroCalculator.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 5ED3E73D1DD2A02C008BAC39 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // RetroCalculator 4 | // 5 | // Created by Forrest Knight on 11/8/16. 6 | // Copyright © 2016 Forrest Knight. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AVFoundation 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var outputLbl: UILabel! 15 | 16 | var btnSound: AVAudioPlayer! 17 | 18 | enum Operation: String { 19 | case Divide = "/" 20 | case Multiply = "*" 21 | case Subtract = "-" 22 | case Add = "+" 23 | case Empty = "Empty" 24 | } 25 | 26 | var currentOperation = Operation.Empty 27 | var runningNumber = "" 28 | var leftValStr = "" 29 | var rightValStr = "" 30 | var result = "" 31 | 32 | override func viewDidLoad() { 33 | super.viewDidLoad() 34 | // Do any additional setup after loading the view, typically from a nib. 35 | 36 | let path = Bundle.main.path(forResource: "btn", ofType: "wav") 37 | let soundURL = URL(fileURLWithPath: path!) 38 | 39 | do { 40 | try btnSound = AVAudioPlayer(contentsOf: soundURL) 41 | btnSound.prepareToPlay() 42 | } catch let err as NSError { 43 | print(err.debugDescription) 44 | } 45 | 46 | } 47 | 48 | @IBAction func numberPressed(sender: UIButton) { 49 | playSound() 50 | 51 | runningNumber += "\(sender.tag)" 52 | outputLbl.text = runningNumber 53 | 54 | } 55 | 56 | @IBAction func onDividePressed(sender: AnyObject) { 57 | processOperation(operation: .Divide) 58 | } 59 | 60 | 61 | @IBAction func onMultiplyPressed(sender: AnyObject) { 62 | processOperation(operation: .Multiply) 63 | } 64 | 65 | @IBAction func onSubtractPressed(sender: AnyObject) { 66 | processOperation(operation: .Subtract) 67 | } 68 | 69 | @IBAction func onAddPressed(sender: AnyObject) { 70 | processOperation(operation: .Add) 71 | } 72 | 73 | @IBAction func onEqualPressed(sender: AnyObject) { 74 | processOperation(operation: currentOperation) 75 | } 76 | 77 | @IBAction func onClearPressed(sender: AnyObject) { 78 | result = "" 79 | runningNumber = "" 80 | currentOperation = Operation.Empty 81 | outputLbl.text = runningNumber 82 | } 83 | 84 | func playSound() { 85 | if btnSound.isPlaying { 86 | btnSound.stop() 87 | } 88 | 89 | btnSound.play() 90 | } 91 | 92 | func processOperation(operation: Operation) { 93 | if currentOperation != Operation.Empty { 94 | 95 | //A user selected an operator, but then selected another operator without firstentering a number 96 | if runningNumber != "" { 97 | rightValStr = runningNumber 98 | runningNumber = "" 99 | 100 | if currentOperation == Operation.Multiply { 101 | result = "\(Double(leftValStr)! * Double(rightValStr)!)" 102 | } else if currentOperation == Operation.Divide { 103 | result = "\(Double(leftValStr)! / Double(rightValStr)!)" 104 | } else if currentOperation == Operation.Subtract { 105 | result = "\(Double(leftValStr)! - Double(rightValStr)!)" 106 | } else if currentOperation == Operation.Add { 107 | result = "\(Double(leftValStr)! + Double(rightValStr)!)" 108 | } 109 | 110 | leftValStr = result 111 | 112 | outputLbl.text = result 113 | 114 | } 115 | 116 | currentOperation = operation 117 | 118 | } else { 119 | //This is the first time an operator has been pressed 120 | leftValStr = runningNumber 121 | runningNumber = "" 122 | currentOperation = operation 123 | } 124 | } 125 | 126 | 127 | } 128 | 129 | -------------------------------------------------------------------------------- /btn.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ForrestKnight/RetroCalculator/a383f699d7622f87923be5d3180f0bd162c84daa/btn.wav --------------------------------------------------------------------------------