From b8438b2a361faaa76ef24fc349c9d22a03385883 Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Tue, 8 Jan 2019 16:21:40 -0600 Subject: [PATCH 1/7] create custom class and build control view --- .../UserStarRating.xcodeproj/project.pbxproj | 361 ++++++++++++++++++ .../UserStarRating/AppDelegate.swift | 46 +++ .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../UserStarRating/Base.lproj/Main.storyboard | 60 +++ .../CustomControls/CustomControl.swift | 54 +++ .../UserStarRating/UserStarRating/Info.plist | 45 +++ .../View Controllers/ViewController.swift | 26 ++ 9 files changed, 721 insertions(+) create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating.xcodeproj/project.pbxproj create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/AppDelegate.swift create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/Contents.json create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/LaunchScreen.storyboard create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Info.plist create mode 100644 Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/View Controllers/ViewController.swift diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating.xcodeproj/project.pbxproj b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating.xcodeproj/project.pbxproj new file mode 100644 index 00000000..46e55ac7 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating.xcodeproj/project.pbxproj @@ -0,0 +1,361 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + D165880921E543890060B1D6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D165880821E543890060B1D6 /* AppDelegate.swift */; }; + D165880B21E543890060B1D6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D165880A21E543890060B1D6 /* ViewController.swift */; }; + D165880E21E543890060B1D6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D165880C21E543890060B1D6 /* Main.storyboard */; }; + D165881021E5438B0060B1D6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D165880F21E5438B0060B1D6 /* Assets.xcassets */; }; + D165881321E5438B0060B1D6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D165881121E5438B0060B1D6 /* LaunchScreen.storyboard */; }; + D165881D21E5451A0060B1D6 /* CustomControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D165881C21E5451A0060B1D6 /* CustomControl.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D165880521E543890060B1D6 /* UserStarRating.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UserStarRating.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D165880821E543890060B1D6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D165880A21E543890060B1D6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D165880D21E543890060B1D6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D165880F21E5438B0060B1D6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D165881221E5438B0060B1D6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D165881421E5438B0060B1D6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D165881C21E5451A0060B1D6 /* CustomControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomControl.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D165880221E543890060B1D6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D16587FC21E543890060B1D6 = { + isa = PBXGroup; + children = ( + D165880721E543890060B1D6 /* UserStarRating */, + D165880621E543890060B1D6 /* Products */, + ); + sourceTree = ""; + }; + D165880621E543890060B1D6 /* Products */ = { + isa = PBXGroup; + children = ( + D165880521E543890060B1D6 /* UserStarRating.app */, + ); + name = Products; + sourceTree = ""; + }; + D165880721E543890060B1D6 /* UserStarRating */ = { + isa = PBXGroup; + children = ( + D165880821E543890060B1D6 /* AppDelegate.swift */, + D165881B21E544ED0060B1D6 /* CustomControls */, + D165881A21E5446B0060B1D6 /* View Controllers */, + D165880C21E543890060B1D6 /* Main.storyboard */, + D165880F21E5438B0060B1D6 /* Assets.xcassets */, + D165881121E5438B0060B1D6 /* LaunchScreen.storyboard */, + D165881421E5438B0060B1D6 /* Info.plist */, + ); + path = UserStarRating; + sourceTree = ""; + }; + D165881A21E5446B0060B1D6 /* View Controllers */ = { + isa = PBXGroup; + children = ( + D165880A21E543890060B1D6 /* ViewController.swift */, + ); + path = "View Controllers"; + sourceTree = ""; + }; + D165881B21E544ED0060B1D6 /* CustomControls */ = { + isa = PBXGroup; + children = ( + D165881C21E5451A0060B1D6 /* CustomControl.swift */, + ); + path = CustomControls; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D165880421E543890060B1D6 /* UserStarRating */ = { + isa = PBXNativeTarget; + buildConfigurationList = D165881721E5438B0060B1D6 /* Build configuration list for PBXNativeTarget "UserStarRating" */; + buildPhases = ( + D165880121E543890060B1D6 /* Sources */, + D165880221E543890060B1D6 /* Frameworks */, + D165880321E543890060B1D6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = UserStarRating; + productName = UserStarRating; + productReference = D165880521E543890060B1D6 /* UserStarRating.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D16587FD21E543890060B1D6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Benjamin Hakes"; + TargetAttributes = { + D165880421E543890060B1D6 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = D165880021E543890060B1D6 /* Build configuration list for PBXProject "UserStarRating" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D16587FC21E543890060B1D6; + productRefGroup = D165880621E543890060B1D6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D165880421E543890060B1D6 /* UserStarRating */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D165880321E543890060B1D6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D165881321E5438B0060B1D6 /* LaunchScreen.storyboard in Resources */, + D165881021E5438B0060B1D6 /* Assets.xcassets in Resources */, + D165880E21E543890060B1D6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D165880121E543890060B1D6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D165880B21E543890060B1D6 /* ViewController.swift in Sources */, + D165881D21E5451A0060B1D6 /* CustomControl.swift in Sources */, + D165880921E543890060B1D6 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D165880C21E543890060B1D6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D165880D21E543890060B1D6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D165881121E5438B0060B1D6 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D165881221E5438B0060B1D6 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D165881521E5438B0060B1D6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + D165881621E5438B0060B1D6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D165881821E5438B0060B1D6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S5U94G8XN2; + INFOPLIST_FILE = UserStarRating/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mettabits.UserStarRating; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D165881921E5438B0060B1D6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S5U94G8XN2; + INFOPLIST_FILE = UserStarRating/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mettabits.UserStarRating; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D165880021E543890060B1D6 /* Build configuration list for PBXProject "UserStarRating" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D165881521E5438B0060B1D6 /* Debug */, + D165881621E5438B0060B1D6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D165881721E5438B0060B1D6 /* Build configuration list for PBXNativeTarget "UserStarRating" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D165881821E5438B0060B1D6 /* Debug */, + D165881921E5438B0060B1D6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D16587FD21E543890060B1D6 /* Project object */; +} diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/AppDelegate.swift b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/AppDelegate.swift new file mode 100644 index 00000000..8cc5fddf --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// UserStarRating +// +// Created by Benjamin Hakes on 1/8/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // 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. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // 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. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // 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. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/Contents.json b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard new file mode 100644 index 00000000..e96f03a5 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift new file mode 100644 index 00000000..3686eeb3 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift @@ -0,0 +1,54 @@ +// +// CustomControl.swift +// UserStarRating +// +// Created by Benjamin Hakes on 1/8/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +import UIKit + +class CustomControl: UIControl { + + static var value: Int = 1 + private let componentDimension: CGFloat = 40.0 + private let componentCount = 5 + private let componentActiveColor = UIColor.black + private let componentInactiveColor = UIColor.gray + + required init?(coder aCoder: NSCoder){ + super.init(coder: aCoder) + + setup() + } + + private func setup(){ + var labelArray: [UILabel] = [] + for x in 0..<5{ + labelArray.append(UILabel()) + guard let mostRecentLabel = labelArray.last else {fatalError("could not get last element")} + mostRecentLabel.tag = x + 1 + mostRecentLabel.frame = CGRect(origin: CGPoint(x: 8.0 + (Double(x) * 48.0), y: 0.0), size: CGSize(width: componentDimension, height: componentDimension)) + mostRecentLabel.font = UIFont.boldSystemFont(ofSize: CGFloat(integerLiteral: 32)) + mostRecentLabel.text = "★" + mostRecentLabel.textAlignment = .center + if x > 0 { + mostRecentLabel.textColor = componentActiveColor + } else { + mostRecentLabel.textColor = componentInactiveColor + } + + self.addSubview(mostRecentLabel) + + + } + print(labelArray) + } + + override var intrinsicContentSize: CGSize { + let componentsWidth = CGFloat(componentCount) * componentDimension + let componentsSpacing = CGFloat(componentCount + 1) * 8.0 + let width = componentsWidth + componentsSpacing + return CGSize(width: width, height: componentDimension) + } +} diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Info.plist b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/View Controllers/ViewController.swift b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/View Controllers/ViewController.swift new file mode 100644 index 00000000..9cdffa4a --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/View Controllers/ViewController.swift @@ -0,0 +1,26 @@ +// +// ViewController.swift +// UserStarRating +// +// Created by Benjamin Hakes on 1/8/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + @IBAction func updateRating(_ ratingControl: CustomControl) { + + let value = CustomControl.value + if value > 1{ + self.title = ("User Rating: \(CustomControl.value) stars") + } else { + self.title = ("User Rating: \(CustomControl.value) star") + } + + } + + +} + From 60818debbaaf7411eb3fd076e32bacbd6320bf09 Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Tue, 8 Jan 2019 18:21:52 -0600 Subject: [PATCH 2/7] add interactivity and complete MVP --- .../UserStarRating/Base.lproj/Main.storyboard | 9 +- .../CustomControls/CustomControl.swift | 86 ++++++++++++++++++- .../View Controllers/ViewController.swift | 8 +- 3 files changed, 90 insertions(+), 13 deletions(-) diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard index e96f03a5..0028266c 100644 --- a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/Base.lproj/Main.storyboard @@ -26,10 +26,10 @@ - + - + @@ -38,7 +38,7 @@ - + @@ -49,10 +49,9 @@ - + - diff --git a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift index 3686eeb3..988485ce 100644 --- a/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift +++ b/Sprint 6/Module 2-Custom Controls/UserStarRating/UserStarRating/CustomControls/CustomControl.swift @@ -10,7 +10,12 @@ import UIKit class CustomControl: UIControl { - static var value: Int = 1 + var value: Int = 1 { + didSet { + + } + } + private var labelArray: [UILabel] = [] private let componentDimension: CGFloat = 40.0 private let componentCount = 5 private let componentActiveColor = UIColor.black @@ -23,12 +28,11 @@ class CustomControl: UIControl { } private func setup(){ - var labelArray: [UILabel] = [] for x in 0..<5{ labelArray.append(UILabel()) guard let mostRecentLabel = labelArray.last else {fatalError("could not get last element")} mostRecentLabel.tag = x + 1 - mostRecentLabel.frame = CGRect(origin: CGPoint(x: 8.0 + (Double(x) * 48.0), y: 0.0), size: CGSize(width: componentDimension, height: componentDimension)) + mostRecentLabel.frame = CGRect(origin: CGPoint(x: 8.0 + (Double(x) * 40.0), y: 0.0), size: CGSize(width: componentDimension, height: componentDimension)) mostRecentLabel.font = UIFont.boldSystemFont(ofSize: CGFloat(integerLiteral: 32)) mostRecentLabel.text = "★" mostRecentLabel.textAlignment = .center @@ -42,7 +46,6 @@ class CustomControl: UIControl { } - print(labelArray) } override var intrinsicContentSize: CGSize { @@ -51,4 +54,79 @@ class CustomControl: UIControl { let width = componentsWidth + componentsSpacing return CGSize(width: width, height: componentDimension) } + + override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + + updateValue(at: touch) + sendActions(for: [.touchDown,.valueChanged]) + return true + } + + override func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + defer { + super.endTracking(touch, with: event) + } + + let touchPoint = touch.location(in: self) + + if bounds.contains(touchPoint){ + // TODO: Implement func + updateValue(at: touch) + sendActions(for: [.touchDragInside, .valueChanged]) + } else { + sendActions(for: [.touchDragOutside]) + } + return true + } + + override func endTracking(_ touch: UITouch?, with event: UIEvent?) { + defer { + super.endTracking(touch, with: event) + } + guard let touch = touch else { return } + + let touchPoint = touch.location(in: self) + + if bounds.contains(touchPoint){ + updateValue(at: touch) + sendActions(for: [.touchUpInside, .valueChanged]) + } else { + sendActions(for: [.touchUpOutside]) + } + + } + + override func cancelTracking(with event: UIEvent?) { + sendActions(for: [.touchCancel]) + super.cancelTracking(with: event) + } + + func updateValue(at touch: UITouch) { + + let touchPoint = touch.location(in: self) + print(touchPoint) + for index in 0.. 1{ - self.title = ("User Rating: \(CustomControl.value) stars") + let value = ratingControl.value + if value > 1 { + self.title = ("User Rating: \(value) stars") } else { - self.title = ("User Rating: \(CustomControl.value) star") + self.title = ("User Rating: \(value) star") } } From 33365d42636fdf53120a70cfa941154fa59ba0f0 Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Tue, 22 Jan 2019 14:13:57 -0600 Subject: [PATCH 3/7] add new playground --- .../CountedSetPlayground.playground/Contents.swift | 3 +++ .../CountedSetPlayground.playground/contents.xcplayground | 4 ++++ .../CountedSetPlayground.playground/timeline.xctimeline | 6 ++++++ 3 files changed, 13 insertions(+) create mode 100644 Sprint 7/Generics (7.2)/CountedSetPlayground.playground/Contents.swift create mode 100644 Sprint 7/Generics (7.2)/CountedSetPlayground.playground/contents.xcplayground create mode 100644 Sprint 7/Generics (7.2)/CountedSetPlayground.playground/timeline.xctimeline diff --git a/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/Contents.swift b/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/Contents.swift new file mode 100644 index 00000000..49c1ff6d --- /dev/null +++ b/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/Contents.swift @@ -0,0 +1,3 @@ +import UIKit + +var str = "Hello, playground" diff --git a/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/contents.xcplayground b/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/contents.xcplayground new file mode 100644 index 00000000..9f5f2f40 --- /dev/null +++ b/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/timeline.xctimeline b/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/timeline.xctimeline new file mode 100644 index 00000000..bf468afe --- /dev/null +++ b/Sprint 7/Generics (7.2)/CountedSetPlayground.playground/timeline.xctimeline @@ -0,0 +1,6 @@ + + + + + From 4764970c667de0ea227b91cd4a0a384fdb0a3395 Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Wed, 13 Feb 2019 16:54:45 -0600 Subject: [PATCH 4/7] add frameworks, api, testing, MVP --- Sprint 9/Creating Frameworks/FrameworksPractice | 1 + Sprint 9/Creating Frameworks/LoadingFramework | 1 + 2 files changed, 2 insertions(+) create mode 160000 Sprint 9/Creating Frameworks/FrameworksPractice create mode 160000 Sprint 9/Creating Frameworks/LoadingFramework diff --git a/Sprint 9/Creating Frameworks/FrameworksPractice b/Sprint 9/Creating Frameworks/FrameworksPractice new file mode 160000 index 00000000..e80143d3 --- /dev/null +++ b/Sprint 9/Creating Frameworks/FrameworksPractice @@ -0,0 +1 @@ +Subproject commit e80143d36d385a3a14f4f7a3716df9325fcce39e diff --git a/Sprint 9/Creating Frameworks/LoadingFramework b/Sprint 9/Creating Frameworks/LoadingFramework new file mode 160000 index 00000000..dc6c8d09 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingFramework @@ -0,0 +1 @@ +Subproject commit dc6c8d0956063da13f49042e726c00b6aa8a48bf From dc4b1fdb7e478c19d1d030c3675a0632706036c9 Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Thu, 14 Feb 2019 18:17:48 -0600 Subject: [PATCH 5/7] update functionality to add notification design pattern --- Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift | 2 +- Sprint 9/Creating Frameworks/LoadingFramework | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift b/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift index 18a7145d..c59af742 100644 --- a/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift +++ b/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift @@ -102,6 +102,6 @@ class IndeterminateLoadingView: UIView, CAAnimationDelegate { private(set) var isAnimating = false private let shapeLayer = CAShapeLayer() - private let duration = 1.0 + private let duration = 5.0 private var shouldStopAnimationOnNextCycle = false } diff --git a/Sprint 9/Creating Frameworks/LoadingFramework b/Sprint 9/Creating Frameworks/LoadingFramework index dc6c8d09..c7c4560f 160000 --- a/Sprint 9/Creating Frameworks/LoadingFramework +++ b/Sprint 9/Creating Frameworks/LoadingFramework @@ -1 +1 @@ -Subproject commit dc6c8d0956063da13f49042e726c00b6aa8a48bf +Subproject commit c7c4560ff3cb6dc02a0ef5cb8556abbe6bec9127 From 59afeba07f9764141ade39adee80c5d6f6a126eb Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Thu, 28 Feb 2019 15:17:47 -0600 Subject: [PATCH 6/7] add nscal storyboard and bhstack model --- .../NSCalculator.xcodeproj/project.pbxproj | 348 ++++++++++++++++++ .../NSCalculator/NSCalculator/AppDelegate.h | 17 + .../NSCalculator/NSCalculator/AppDelegate.m | 24 ++ .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../NSCalculator/NSCalculator/BHStack.h | 25 ++ .../NSCalculator/NSCalculator/BHStack.m | 41 +++ .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../NSCalculator/Base.lproj/Main.storyboard | 147 ++++++++ .../NSCalculator/NSCalculator/Info.plist | 45 +++ .../NSCalculator/ViewController.h | 15 + .../NSCalculator/ViewController.m | 23 ++ .../Module 4/NSCalculator/NSCalculator/main.m | 16 + .../NSCalculator.xcodeproj/project.pbxproj | 342 +++++++++++++++++ .../NSCalculator/NSCalculator/AppDelegate.h | 17 + .../NSCalculator/NSCalculator/AppDelegate.m | 51 +++ .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../NSCalculator/Base.lproj/Main.storyboard | 24 ++ .../NSCalculator/NSCalculator/Info.plist | 45 +++ .../NSCalculator/ViewController.h | 15 + .../NSCalculator/ViewController.m | 23 ++ .../Module 4/NSCalculator/NSCalculator/main.m | 16 + 24 files changed, 1492 insertions(+) create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.h create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.m create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.h create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/Info.plist create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/main.m create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.h create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.m create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/Info.plist create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.h create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.m create mode 100644 Sprint 12/Module 4/NSCalculator/NSCalculator/main.m diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj b/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj new file mode 100644 index 00000000..731e0d5c --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj @@ -0,0 +1,348 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + D19162AA22287E57005CE4FD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162A922287E57005CE4FD /* AppDelegate.m */; }; + D19162AD22287E57005CE4FD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162AC22287E57005CE4FD /* ViewController.m */; }; + D19162B022287E57005CE4FD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D19162AE22287E57005CE4FD /* Main.storyboard */; }; + D19162B222287E58005CE4FD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D19162B122287E58005CE4FD /* Assets.xcassets */; }; + D19162B522287E58005CE4FD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D19162B322287E58005CE4FD /* LaunchScreen.storyboard */; }; + D19162B822287E58005CE4FD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162B722287E58005CE4FD /* main.m */; }; + D19162C0222882F0005CE4FD /* BHStack.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162BF222882F0005CE4FD /* BHStack.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D19162A522287E57005CE4FD /* NSCalculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSCalculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D19162A822287E57005CE4FD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + D19162A922287E57005CE4FD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + D19162AB22287E57005CE4FD /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + D19162AC22287E57005CE4FD /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + D19162AF22287E57005CE4FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D19162B122287E58005CE4FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D19162B422287E58005CE4FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D19162B622287E58005CE4FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D19162B722287E58005CE4FD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + D19162BE222882F0005CE4FD /* BHStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BHStack.h; sourceTree = ""; }; + D19162BF222882F0005CE4FD /* BHStack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BHStack.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D19162A222287E57005CE4FD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D191629C22287E57005CE4FD = { + isa = PBXGroup; + children = ( + D19162A722287E57005CE4FD /* NSCalculator */, + D19162A622287E57005CE4FD /* Products */, + ); + sourceTree = ""; + }; + D19162A622287E57005CE4FD /* Products */ = { + isa = PBXGroup; + children = ( + D19162A522287E57005CE4FD /* NSCalculator.app */, + ); + name = Products; + sourceTree = ""; + }; + D19162A722287E57005CE4FD /* NSCalculator */ = { + isa = PBXGroup; + children = ( + D19162A822287E57005CE4FD /* AppDelegate.h */, + D19162A922287E57005CE4FD /* AppDelegate.m */, + D19162AB22287E57005CE4FD /* ViewController.h */, + D19162AC22287E57005CE4FD /* ViewController.m */, + D19162AE22287E57005CE4FD /* Main.storyboard */, + D19162B122287E58005CE4FD /* Assets.xcassets */, + D19162B322287E58005CE4FD /* LaunchScreen.storyboard */, + D19162B622287E58005CE4FD /* Info.plist */, + D19162B722287E58005CE4FD /* main.m */, + D19162BE222882F0005CE4FD /* BHStack.h */, + D19162BF222882F0005CE4FD /* BHStack.m */, + ); + path = NSCalculator; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D19162A422287E57005CE4FD /* NSCalculator */ = { + isa = PBXNativeTarget; + buildConfigurationList = D19162BB22287E58005CE4FD /* Build configuration list for PBXNativeTarget "NSCalculator" */; + buildPhases = ( + D19162A122287E57005CE4FD /* Sources */, + D19162A222287E57005CE4FD /* Frameworks */, + D19162A322287E57005CE4FD /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NSCalculator; + productName = NSCalculator; + productReference = D19162A522287E57005CE4FD /* NSCalculator.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D191629D22287E57005CE4FD /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Benjamin Hakes"; + TargetAttributes = { + D19162A422287E57005CE4FD = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = D19162A022287E57005CE4FD /* Build configuration list for PBXProject "NSCalculator" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D191629C22287E57005CE4FD; + productRefGroup = D19162A622287E57005CE4FD /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D19162A422287E57005CE4FD /* NSCalculator */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D19162A322287E57005CE4FD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D19162B522287E58005CE4FD /* LaunchScreen.storyboard in Resources */, + D19162B222287E58005CE4FD /* Assets.xcassets in Resources */, + D19162B022287E57005CE4FD /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D19162A122287E57005CE4FD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D19162C0222882F0005CE4FD /* BHStack.m in Sources */, + D19162AD22287E57005CE4FD /* ViewController.m in Sources */, + D19162B822287E58005CE4FD /* main.m in Sources */, + D19162AA22287E57005CE4FD /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D19162AE22287E57005CE4FD /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D19162AF22287E57005CE4FD /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D19162B322287E58005CE4FD /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D19162B422287E58005CE4FD /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D19162B922287E58005CE4FD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + D19162BA22287E58005CE4FD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D19162BC22287E58005CE4FD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S5U94G8XN2; + INFOPLIST_FILE = NSCalculator/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mettabits.NSCalculator; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D19162BD22287E58005CE4FD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S5U94G8XN2; + INFOPLIST_FILE = NSCalculator/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mettabits.NSCalculator; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D19162A022287E57005CE4FD /* Build configuration list for PBXProject "NSCalculator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D19162B922287E58005CE4FD /* Debug */, + D19162BA22287E58005CE4FD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D19162BB22287E58005CE4FD /* Build configuration list for PBXNativeTarget "NSCalculator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D19162BC22287E58005CE4FD /* Debug */, + D19162BD22287E58005CE4FD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D191629D22287E57005CE4FD /* Project object */; +} diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.h b/Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.h new file mode 100644 index 00000000..f1cacbaf --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.m b/Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.m new file mode 100644 index 00000000..a56911c6 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/AppDelegate.m @@ -0,0 +1,24 @@ +// +// AppDelegate.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +@end diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json b/Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.h b/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.h new file mode 100644 index 00000000..a2681079 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.h @@ -0,0 +1,25 @@ +// +// BHStack.h +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BHStack : NSObject + +-(instancetype)initWith: (NSArray *)array; + +-(void)push: (NSNumber *)number; + +-(NSNumber *)pop; + +-(NSNumber *)peak; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m b/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m new file mode 100644 index 00000000..4a0a4a4d --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m @@ -0,0 +1,41 @@ +// +// BHStack.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import "BHStack.h" + +@interface BHStack () + +@property NSMutableArray *values; + +@end + +@implementation BHStack + +-(instancetype)initWith: (NSArray *)array{ + self = [super init]; + if (self) { + _values = [array mutableCopy]; + + } + return self; +} + +-(void)push: (NSNumber *)number{ + +} + +-(NSNumber *)pop{ + +} + +-(NSNumber *)peak{ + +} + + +@end diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard b/Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard b/Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard new file mode 100644 index 00000000..66a40725 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/Info.plist b/Sprint 11/Module 4/NSCalculator/NSCalculator/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h b/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h new file mode 100644 index 00000000..05631c48 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m b/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m new file mode 100644 index 00000000..d4ab1854 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + + +@end diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/main.m b/Sprint 11/Module 4/NSCalculator/NSCalculator/main.m new file mode 100644 index 00000000..ce092694 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/main.m @@ -0,0 +1,16 @@ +// +// main.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj b/Sprint 12/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj new file mode 100644 index 00000000..73038955 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj @@ -0,0 +1,342 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + D19162AA22287E57005CE4FD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162A922287E57005CE4FD /* AppDelegate.m */; }; + D19162AD22287E57005CE4FD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162AC22287E57005CE4FD /* ViewController.m */; }; + D19162B022287E57005CE4FD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D19162AE22287E57005CE4FD /* Main.storyboard */; }; + D19162B222287E58005CE4FD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D19162B122287E58005CE4FD /* Assets.xcassets */; }; + D19162B522287E58005CE4FD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D19162B322287E58005CE4FD /* LaunchScreen.storyboard */; }; + D19162B822287E58005CE4FD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162B722287E58005CE4FD /* main.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D19162A522287E57005CE4FD /* NSCalculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSCalculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D19162A822287E57005CE4FD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + D19162A922287E57005CE4FD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + D19162AB22287E57005CE4FD /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + D19162AC22287E57005CE4FD /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + D19162AF22287E57005CE4FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D19162B122287E58005CE4FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D19162B422287E58005CE4FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D19162B622287E58005CE4FD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D19162B722287E58005CE4FD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D19162A222287E57005CE4FD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D191629C22287E57005CE4FD = { + isa = PBXGroup; + children = ( + D19162A722287E57005CE4FD /* NSCalculator */, + D19162A622287E57005CE4FD /* Products */, + ); + sourceTree = ""; + }; + D19162A622287E57005CE4FD /* Products */ = { + isa = PBXGroup; + children = ( + D19162A522287E57005CE4FD /* NSCalculator.app */, + ); + name = Products; + sourceTree = ""; + }; + D19162A722287E57005CE4FD /* NSCalculator */ = { + isa = PBXGroup; + children = ( + D19162A822287E57005CE4FD /* AppDelegate.h */, + D19162A922287E57005CE4FD /* AppDelegate.m */, + D19162AB22287E57005CE4FD /* ViewController.h */, + D19162AC22287E57005CE4FD /* ViewController.m */, + D19162AE22287E57005CE4FD /* Main.storyboard */, + D19162B122287E58005CE4FD /* Assets.xcassets */, + D19162B322287E58005CE4FD /* LaunchScreen.storyboard */, + D19162B622287E58005CE4FD /* Info.plist */, + D19162B722287E58005CE4FD /* main.m */, + ); + path = NSCalculator; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D19162A422287E57005CE4FD /* NSCalculator */ = { + isa = PBXNativeTarget; + buildConfigurationList = D19162BB22287E58005CE4FD /* Build configuration list for PBXNativeTarget "NSCalculator" */; + buildPhases = ( + D19162A122287E57005CE4FD /* Sources */, + D19162A222287E57005CE4FD /* Frameworks */, + D19162A322287E57005CE4FD /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NSCalculator; + productName = NSCalculator; + productReference = D19162A522287E57005CE4FD /* NSCalculator.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D191629D22287E57005CE4FD /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Benjamin Hakes"; + TargetAttributes = { + D19162A422287E57005CE4FD = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = D19162A022287E57005CE4FD /* Build configuration list for PBXProject "NSCalculator" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D191629C22287E57005CE4FD; + productRefGroup = D19162A622287E57005CE4FD /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D19162A422287E57005CE4FD /* NSCalculator */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D19162A322287E57005CE4FD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D19162B522287E58005CE4FD /* LaunchScreen.storyboard in Resources */, + D19162B222287E58005CE4FD /* Assets.xcassets in Resources */, + D19162B022287E57005CE4FD /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D19162A122287E57005CE4FD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D19162AD22287E57005CE4FD /* ViewController.m in Sources */, + D19162B822287E58005CE4FD /* main.m in Sources */, + D19162AA22287E57005CE4FD /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D19162AE22287E57005CE4FD /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D19162AF22287E57005CE4FD /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D19162B322287E58005CE4FD /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D19162B422287E58005CE4FD /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D19162B922287E58005CE4FD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + D19162BA22287E58005CE4FD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D19162BC22287E58005CE4FD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S5U94G8XN2; + INFOPLIST_FILE = NSCalculator/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mettabits.NSCalculator; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D19162BD22287E58005CE4FD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S5U94G8XN2; + INFOPLIST_FILE = NSCalculator/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mettabits.NSCalculator; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D19162A022287E57005CE4FD /* Build configuration list for PBXProject "NSCalculator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D19162B922287E58005CE4FD /* Debug */, + D19162BA22287E58005CE4FD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D19162BB22287E58005CE4FD /* Build configuration list for PBXNativeTarget "NSCalculator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D19162BC22287E58005CE4FD /* Debug */, + D19162BD22287E58005CE4FD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D191629D22287E57005CE4FD /* Project object */; +} diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.h b/Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.h new file mode 100644 index 00000000..f1cacbaf --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.m b/Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.m new file mode 100644 index 00000000..9b3c9342 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // 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. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // 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. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // 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. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + + +@end diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json b/Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard b/Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard b/Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard new file mode 100644 index 00000000..942f0bc4 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/Info.plist b/Sprint 12/Module 4/NSCalculator/NSCalculator/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.h b/Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.h new file mode 100644 index 00000000..05631c48 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.m b/Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.m new file mode 100644 index 00000000..d4ab1854 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + + +@end diff --git a/Sprint 12/Module 4/NSCalculator/NSCalculator/main.m b/Sprint 12/Module 4/NSCalculator/NSCalculator/main.m new file mode 100644 index 00000000..ce092694 --- /dev/null +++ b/Sprint 12/Module 4/NSCalculator/NSCalculator/main.m @@ -0,0 +1,16 @@ +// +// main.m +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} From 5d9b02255b9bbb04843c4f43341706b8669fbab4 Mon Sep 17 00:00:00 2001 From: Ben Hakes Date: Thu, 28 Feb 2019 15:28:44 -0600 Subject: [PATCH 7/7] implement methods on BHStack --- .../NSCalculator.xcodeproj/project.pbxproj | 30 ++++++++++++++----- .../NSCalculator/Model/BHCalculator.h | 26 ++++++++++++++++ .../BHCalculator.m} | 8 ++--- .../NSCalculator/{ => Model}/BHStack.h | 0 .../NSCalculator/{ => Model}/BHStack.m | 7 +++-- .../NSCalculator/ViewController.m | 23 -------------- 6 files changed, 57 insertions(+), 37 deletions(-) create mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.h rename Sprint 11/Module 4/NSCalculator/NSCalculator/{ViewController.h => Model/BHCalculator.m} (59%) rename Sprint 11/Module 4/NSCalculator/NSCalculator/{ => Model}/BHStack.h (100%) rename Sprint 11/Module 4/NSCalculator/NSCalculator/{ => Model}/BHStack.m (73%) delete mode 100644 Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj b/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj index 731e0d5c..9b662d20 100644 --- a/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator.xcodeproj/project.pbxproj @@ -8,20 +8,18 @@ /* Begin PBXBuildFile section */ D19162AA22287E57005CE4FD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162A922287E57005CE4FD /* AppDelegate.m */; }; - D19162AD22287E57005CE4FD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162AC22287E57005CE4FD /* ViewController.m */; }; D19162B022287E57005CE4FD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D19162AE22287E57005CE4FD /* Main.storyboard */; }; D19162B222287E58005CE4FD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D19162B122287E58005CE4FD /* Assets.xcassets */; }; D19162B522287E58005CE4FD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D19162B322287E58005CE4FD /* LaunchScreen.storyboard */; }; D19162B822287E58005CE4FD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162B722287E58005CE4FD /* main.m */; }; D19162C0222882F0005CE4FD /* BHStack.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162BF222882F0005CE4FD /* BHStack.m */; }; + D19162C422288838005CE4FD /* BHCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = D19162C322288838005CE4FD /* BHCalculator.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ D19162A522287E57005CE4FD /* NSCalculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSCalculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; D19162A822287E57005CE4FD /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; D19162A922287E57005CE4FD /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - D19162AB22287E57005CE4FD /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - D19162AC22287E57005CE4FD /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; D19162AF22287E57005CE4FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; D19162B122287E58005CE4FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; D19162B422287E58005CE4FD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -29,6 +27,8 @@ D19162B722287E58005CE4FD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; D19162BE222882F0005CE4FD /* BHStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BHStack.h; sourceTree = ""; }; D19162BF222882F0005CE4FD /* BHStack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BHStack.m; sourceTree = ""; }; + D19162C222288838005CE4FD /* BHCalculator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BHCalculator.h; sourceTree = ""; }; + D19162C322288838005CE4FD /* BHCalculator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BHCalculator.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -61,19 +61,35 @@ D19162A722287E57005CE4FD /* NSCalculator */ = { isa = PBXGroup; children = ( + D19162C52228883C005CE4FD /* Model */, D19162A822287E57005CE4FD /* AppDelegate.h */, D19162A922287E57005CE4FD /* AppDelegate.m */, - D19162AB22287E57005CE4FD /* ViewController.h */, - D19162AC22287E57005CE4FD /* ViewController.m */, + D19162C12228880E005CE4FD /* ViewControllers */, D19162AE22287E57005CE4FD /* Main.storyboard */, D19162B122287E58005CE4FD /* Assets.xcassets */, D19162B322287E58005CE4FD /* LaunchScreen.storyboard */, D19162B622287E58005CE4FD /* Info.plist */, D19162B722287E58005CE4FD /* main.m */, + ); + path = NSCalculator; + sourceTree = ""; + }; + D19162C12228880E005CE4FD /* ViewControllers */ = { + isa = PBXGroup; + children = ( + ); + path = ViewControllers; + sourceTree = ""; + }; + D19162C52228883C005CE4FD /* Model */ = { + isa = PBXGroup; + children = ( + D19162C222288838005CE4FD /* BHCalculator.h */, + D19162C322288838005CE4FD /* BHCalculator.m */, D19162BE222882F0005CE4FD /* BHStack.h */, D19162BF222882F0005CE4FD /* BHStack.m */, ); - path = NSCalculator; + path = Model; sourceTree = ""; }; /* End PBXGroup section */ @@ -147,7 +163,7 @@ buildActionMask = 2147483647; files = ( D19162C0222882F0005CE4FD /* BHStack.m in Sources */, - D19162AD22287E57005CE4FD /* ViewController.m in Sources */, + D19162C422288838005CE4FD /* BHCalculator.m in Sources */, D19162B822287E58005CE4FD /* main.m in Sources */, D19162AA22287E57005CE4FD /* AppDelegate.m in Sources */, ); diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.h b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.h new file mode 100644 index 00000000..520e6f48 --- /dev/null +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.h @@ -0,0 +1,26 @@ +// +// BHCalculator.h +// NSCalculator +// +// Created by Benjamin Hakes on 2/28/19. +// Copyright © 2019 Benjamin Hakes. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, RPNOperator){ + RPNOperatorAdd, + RPNOperatorSubtract, + RPNOperatorMultiply, + RPNOperatorDivide +}; + +@interface BHCalculator : NSObject + + + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.m similarity index 59% rename from Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h rename to Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.m index 05631c48..9ed7ead8 100644 --- a/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.h +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHCalculator.m @@ -1,15 +1,13 @@ // -// ViewController.h +// BHCalculator.m // NSCalculator // // Created by Benjamin Hakes on 2/28/19. // Copyright © 2019 Benjamin Hakes. All rights reserved. // -#import - -@interface ViewController : UIViewController +#import "BHCalculator.h" +@implementation BHCalculator @end - diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.h b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHStack.h similarity index 100% rename from Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.h rename to Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHStack.h diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHStack.m similarity index 73% rename from Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m rename to Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHStack.m index 4a0a4a4d..81c895a6 100644 --- a/Sprint 11/Module 4/NSCalculator/NSCalculator/BHStack.m +++ b/Sprint 11/Module 4/NSCalculator/NSCalculator/Model/BHStack.m @@ -26,15 +26,18 @@ -(instancetype)initWith: (NSArray *)array{ } -(void)push: (NSNumber *)number{ - + [_values addObject: number]; } -(NSNumber *)pop{ + NSNumber *numberToReturn = [_values lastObject]; + [_values removeLastObject]; + return numberToReturn; } -(NSNumber *)peak{ - + return [_values lastObject]; } diff --git a/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m b/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m deleted file mode 100644 index d4ab1854..00000000 --- a/Sprint 11/Module 4/NSCalculator/NSCalculator/ViewController.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.m -// NSCalculator -// -// Created by Benjamin Hakes on 2/28/19. -// Copyright © 2019 Benjamin Hakes. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - - -@end