diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC.xcodeproj/project.pbxproj b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC.xcodeproj/project.pbxproj new file mode 100644 index 00000000..7772ec07 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC.xcodeproj/project.pbxproj @@ -0,0 +1,392 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FFB24C77222895330096E395 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24C76222895330096E395 /* AppDelegate.m */; }; + FFB24C7D222895330096E395 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFB24C7B222895330096E395 /* Main.storyboard */; }; + FFB24C7F222895350096E395 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FFB24C7E222895350096E395 /* Assets.xcassets */; }; + FFB24C82222895350096E395 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFB24C80222895350096E395 /* LaunchScreen.storyboard */; }; + FFB24C85222895350096E395 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24C84222895350096E395 /* main.m */; }; + FFB24C92222898E20096E395 /* LMSCalculatorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24C91222898E20096E395 /* LMSCalculatorViewController.m */; }; + FFB24C96222899980096E395 /* LMSStack.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24C95222899980096E395 /* LMSStack.m */; }; + FFB24C99222899BD0096E395 /* LMSCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24C98222899BD0096E395 /* LMSCalculator.m */; }; + FFB24C9C222899D60096E395 /* LMSDigitAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24C9B222899D60096E395 /* LMSDigitAccumulator.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FFB24C72222895330096E395 /* RPNCalculatorObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RPNCalculatorObjC.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FFB24C75222895330096E395 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + FFB24C76222895330096E395 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + FFB24C7C222895330096E395 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FFB24C7E222895350096E395 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FFB24C81222895350096E395 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FFB24C83222895350096E395 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFB24C84222895350096E395 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + FFB24C90222898E20096E395 /* LMSCalculatorViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSCalculatorViewController.h; sourceTree = ""; }; + FFB24C91222898E20096E395 /* LMSCalculatorViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSCalculatorViewController.m; sourceTree = ""; }; + FFB24C94222899980096E395 /* LMSStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSStack.h; sourceTree = ""; }; + FFB24C95222899980096E395 /* LMSStack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSStack.m; sourceTree = ""; }; + FFB24C97222899BD0096E395 /* LMSCalculator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSCalculator.h; sourceTree = ""; }; + FFB24C98222899BD0096E395 /* LMSCalculator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSCalculator.m; sourceTree = ""; }; + FFB24C9A222899D60096E395 /* LMSDigitAccumulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSDigitAccumulator.h; sourceTree = ""; }; + FFB24C9B222899D60096E395 /* LMSDigitAccumulator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSDigitAccumulator.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FFB24C6F222895330096E395 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FFB24C69222895330096E395 = { + isa = PBXGroup; + children = ( + FFB24C74222895330096E395 /* RPNCalculatorObjC */, + FFB24C73222895330096E395 /* Products */, + ); + sourceTree = ""; + }; + FFB24C73222895330096E395 /* Products */ = { + isa = PBXGroup; + children = ( + FFB24C72222895330096E395 /* RPNCalculatorObjC.app */, + ); + name = Products; + sourceTree = ""; + }; + FFB24C74222895330096E395 /* RPNCalculatorObjC */ = { + isa = PBXGroup; + children = ( + FFB24C93222899020096E395 /* Model/Medel Controller */, + FFB24C8F2228973A0096E395 /* View Controller */, + FFB24C8D222897110096E395 /* Storyboards */, + FFB24C8E2228972A0096E395 /* Resources */, + ); + path = RPNCalculatorObjC; + sourceTree = ""; + }; + FFB24C8D222897110096E395 /* Storyboards */ = { + isa = PBXGroup; + children = ( + FFB24C7B222895330096E395 /* Main.storyboard */, + FFB24C80222895350096E395 /* LaunchScreen.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + FFB24C8E2228972A0096E395 /* Resources */ = { + isa = PBXGroup; + children = ( + FFB24C75222895330096E395 /* AppDelegate.h */, + FFB24C76222895330096E395 /* AppDelegate.m */, + FFB24C7E222895350096E395 /* Assets.xcassets */, + FFB24C83222895350096E395 /* Info.plist */, + FFB24C84222895350096E395 /* main.m */, + ); + path = Resources; + sourceTree = ""; + }; + FFB24C8F2228973A0096E395 /* View Controller */ = { + isa = PBXGroup; + children = ( + FFB24C90222898E20096E395 /* LMSCalculatorViewController.h */, + FFB24C91222898E20096E395 /* LMSCalculatorViewController.m */, + ); + path = "View Controller"; + sourceTree = ""; + }; + FFB24C93222899020096E395 /* Model/Medel Controller */ = { + isa = PBXGroup; + children = ( + FFB24C94222899980096E395 /* LMSStack.h */, + FFB24C95222899980096E395 /* LMSStack.m */, + FFB24C97222899BD0096E395 /* LMSCalculator.h */, + FFB24C98222899BD0096E395 /* LMSCalculator.m */, + FFB24C9A222899D60096E395 /* LMSDigitAccumulator.h */, + FFB24C9B222899D60096E395 /* LMSDigitAccumulator.m */, + ); + name = "Model/Medel Controller"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FFB24C71222895330096E395 /* RPNCalculatorObjC */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFB24C88222895350096E395 /* Build configuration list for PBXNativeTarget "RPNCalculatorObjC" */; + buildPhases = ( + FFB24C6E222895330096E395 /* Sources */, + FFB24C6F222895330096E395 /* Frameworks */, + FFB24C70222895330096E395 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RPNCalculatorObjC; + productName = RPNCalculatorObjC; + productReference = FFB24C72222895330096E395 /* RPNCalculatorObjC.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FFB24C6A222895330096E395 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Lisa M Sampson"; + TargetAttributes = { + FFB24C71222895330096E395 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = FFB24C6D222895330096E395 /* Build configuration list for PBXProject "RPNCalculatorObjC" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FFB24C69222895330096E395; + productRefGroup = FFB24C73222895330096E395 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FFB24C71222895330096E395 /* RPNCalculatorObjC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FFB24C70222895330096E395 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFB24C82222895350096E395 /* LaunchScreen.storyboard in Resources */, + FFB24C7F222895350096E395 /* Assets.xcassets in Resources */, + FFB24C7D222895330096E395 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FFB24C6E222895330096E395 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFB24C92222898E20096E395 /* LMSCalculatorViewController.m in Sources */, + FFB24C9C222899D60096E395 /* LMSDigitAccumulator.m in Sources */, + FFB24C85222895350096E395 /* main.m in Sources */, + FFB24C77222895330096E395 /* AppDelegate.m in Sources */, + FFB24C99222899BD0096E395 /* LMSCalculator.m in Sources */, + FFB24C96222899980096E395 /* LMSStack.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FFB24C7B222895330096E395 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFB24C7C222895330096E395 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FFB24C80222895350096E395 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFB24C81222895350096E395 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FFB24C86222895350096E395 /* 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; + }; + FFB24C87222895350096E395 /* 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; + }; + FFB24C89222895350096E395 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2LA5UAXN45; + INFOPLIST_FILE = "$(SRCROOT)/RPNCalculatorObjC/Resources/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisamsampson.RPNCalculatorObjC; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FFB24C8A222895350096E395 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2LA5UAXN45; + INFOPLIST_FILE = "$(SRCROOT)/RPNCalculatorObjC/Resources/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisamsampson.RPNCalculatorObjC; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FFB24C6D222895330096E395 /* Build configuration list for PBXProject "RPNCalculatorObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB24C86222895350096E395 /* Debug */, + FFB24C87222895350096E395 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFB24C88222895350096E395 /* Build configuration list for PBXNativeTarget "RPNCalculatorObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB24C89222895350096E395 /* Debug */, + FFB24C8A222895350096E395 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FFB24C6A222895330096E395 /* Project object */; +} diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSCalculator.h b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSCalculator.h new file mode 100644 index 00000000..ea5d940c --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSCalculator.h @@ -0,0 +1,29 @@ +// +// LMSCalculator.h +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSCalculator : NSObject + +typedef NS_ENUM(NSInteger, LMSCalculatorOperator) { + LMSCalculatorOperatorAdd, + LMSCalculatorOperatorSubtract, + LMSCalculatorOperatorMultiply, + LMSCalculatorOperatorDivide +}; + +@property (readonly) double topValue; + +- (void)pushNumber:(double)value; +- (void)applyCalculatorOperator:(LMSCalculatorOperator)calculatorOperator; +- (void)clear; +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSCalculator.m b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSCalculator.m new file mode 100644 index 00000000..d7a9d0c8 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSCalculator.m @@ -0,0 +1,63 @@ +// +// LMSCalculator.m +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSCalculator.h" +#import "LMSStack.h" + +@interface LMSCalculator () + +@property LMSStack *stack; + +@end + +@implementation LMSCalculator + +- (instancetype)init +{ + self = [super init]; + if (self != nil) { + _stack = [[LMSStack alloc] initWithArray:@[@0.0, @0.0]]; + } + return self; +} + +- (double)topValue { + return [[self.stack peek] doubleValue]; +} + +- (void)pushNumber:(double)value { + NSNumber *number = [NSNumber numberWithDouble:value]; + [self.stack push:number]; +} +- (void)applyCalculatorOperator:(LMSCalculatorOperator)calculatorOperator { + + double operand2 = [[self.stack pop] doubleValue]; + double operand1 = [[self.stack pop] doubleValue]; + + double result = 0.0; + switch (calculatorOperator) { + case LMSCalculatorOperatorAdd: + result = operand1 + operand2; + break; + case LMSCalculatorOperatorSubtract: + result = operand1 - operand2; + break; + case LMSCalculatorOperatorMultiply: + result = operand1 * operand2; + break; + case LMSCalculatorOperatorDivide: + result = operand1 / operand2; + break; + } + [self.stack push:[NSNumber numberWithDouble:result]]; +} +- (void)clear { + self.stack = [[LMSStack alloc] initWithArray:@[@0.0, @0.0]]; +} + +@end diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSDigitAccumulator.h b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSDigitAccumulator.h new file mode 100644 index 00000000..87e54807 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSDigitAccumulator.h @@ -0,0 +1,23 @@ +// +// LMSDigitAccumulator.h +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSDigitAccumulator : NSObject + +@property (readonly) double value; + +- (void)addDigitWithNumericValue: (NSInteger)number; +- (void)addDecimalPoint; +- (void)clear; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSDigitAccumulator.m b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSDigitAccumulator.m new file mode 100644 index 00000000..cd907f32 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSDigitAccumulator.m @@ -0,0 +1,47 @@ +// +// LMSDigitAccumulator.m +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSDigitAccumulator.h" + +@interface LMSDigitAccumulator () + +@property NSMutableArray *digits; + +@end + +@implementation LMSDigitAccumulator + +- (instancetype)init { + self = [super init]; + if (self != nil) { + _digits = [NSMutableArray arrayWithArray:@[]]; + } + return self; +} + +- (double)value { + NSString *numberAsString = [self.digits componentsJoinedByString:@""]; + double number = numberAsString.doubleValue; + return number; +} + +- (void)addDigitWithNumericValue: (NSInteger)number { + NSNumber *digit = [NSNumber numberWithInteger:number]; + NSString *string = digit.stringValue; + [self.digits addObject:string]; +} + +- (void)addDecimalPoint { + [self.digits addObject:@"."]; +} + +- (void)clear { + [self.digits removeAllObjects]; +} + +@end diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSStack.h b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSStack.h new file mode 100644 index 00000000..fef5f462 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSStack.h @@ -0,0 +1,23 @@ +// +// LMSStack.h +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSStack : NSObject + +- (instancetype)initWithArray: (NSArray *)array; + +- (void)push: (NSNumber *)value; +- (NSNumber *)pop; +- (NSNumber *)peek; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSStack.m b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSStack.m new file mode 100644 index 00000000..e72bc97f --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/LMSStack.m @@ -0,0 +1,41 @@ +// +// LMSStack.m +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSStack.h" + +@interface LMSStack () + +@property NSMutableArray *values; + +@end + +@implementation LMSStack + +- (instancetype)initWithArray:(NSArray *)array { + self = [super init]; + if (self != nil) { + _values = array.mutableCopy; + } + return self; +} + +- (void)push:(NSNumber *)value { + [self.values addObject:value]; +} + +- (NSNumber *)pop { + NSNumber *last = self.values.lastObject; + [self.values removeLastObject]; + return last; +} + +- (NSNumber *)peek { + return self.values.lastObject; +} + +@end diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/AppDelegate.h b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/AppDelegate.h new file mode 100644 index 00000000..487c8b26 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/AppDelegate.m b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/AppDelegate.m new file mode 100644 index 00000000..cab5358e --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. 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 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/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/RPNCalculatorObjC/RPNCalculatorObjC/Resources/Assets.xcassets/Contents.json b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/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/RPNCalculatorObjC/RPNCalculatorObjC/Resources/Info.plist b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/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/RPNCalculatorObjC/RPNCalculatorObjC/Resources/main.m b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/main.m new file mode 100644 index 00000000..9f2f7a5e --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Resources/main.m @@ -0,0 +1,16 @@ +// +// main.m +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. 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 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Storyboards/Base.lproj/LaunchScreen.storyboard b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Storyboards/Base.lproj/Main.storyboard b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 00000000..1e43f50d --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/View Controller/LMSCalculatorViewController.h b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/View Controller/LMSCalculatorViewController.h new file mode 100644 index 00000000..b787bd39 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/View Controller/LMSCalculatorViewController.h @@ -0,0 +1,19 @@ +// +// LMSCalculatorViewController.h +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSCalculatorViewController : UIViewController + +@property (weak, nonatomic) IBOutlet UITextField *calculatorTextField; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/View Controller/LMSCalculatorViewController.m b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/View Controller/LMSCalculatorViewController.m new file mode 100644 index 00000000..96dcdcd9 --- /dev/null +++ b/Sprint 11/Module 4/RPNCalculatorObjC/RPNCalculatorObjC/View Controller/LMSCalculatorViewController.m @@ -0,0 +1,78 @@ +// +// LMSCalculatorViewController.m +// RPNCalculatorObjC +// +// Created by Lisa Sampson on 2/28/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSCalculatorViewController.h" +#import "LMSCalculator.h" +#import "LMSDigitAccumulator.h" + +@interface LMSCalculatorViewController () + +@property LMSCalculator *calculator; +@property LMSDigitAccumulator *digitAccumulator; +@property NSNumberFormatter *numberFormatter; + +@end + +@implementation LMSCalculatorViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + _calculator = [[LMSCalculator alloc] init]; + _digitAccumulator = [[LMSDigitAccumulator alloc] init]; + _numberFormatter = [[NSNumberFormatter alloc] init]; + + self.numberFormatter.allowsFloats = YES; + self.numberFormatter.maximumIntegerDigits = 20; + self.numberFormatter.minimumFractionDigits = 0; + self.numberFormatter.maximumFractionDigits = 20; +} + +- (IBAction)tapNumberButton:(UIButton *)sender { + [self.digitAccumulator addDigitWithNumericValue:sender.tag]; + [self updateTextFieldWithValue:self.digitAccumulator.value]; +} + +- (IBAction)tapDecimalButton:(UIButton *)sender { + [self.digitAccumulator addDecimalPoint]; + [self updateTextFieldWithValue:self.digitAccumulator.value]; +} + +- (IBAction)tapReturnButton:(UIButton *)sender { + double value = self.digitAccumulator.value; + [self.calculator pushNumber:value]; + [self.digitAccumulator clear]; + [self updateTextFieldWithValue:self.digitAccumulator.value]; +} + +- (IBAction)tapAddButton:(UIButton *)sender { + [self.calculator applyCalculatorOperator:LMSCalculatorOperatorAdd]; + [self updateTextFieldWithValue:self.calculator.topValue]; +} + +- (IBAction)tapSubtractButton:(UIButton *)sender { + [self.calculator applyCalculatorOperator:LMSCalculatorOperatorSubtract]; + [self updateTextFieldWithValue:self.calculator.topValue]; +} + +- (IBAction)tapMultiplyButton:(UIButton *)sender { + [self.calculator applyCalculatorOperator:LMSCalculatorOperatorMultiply]; + [self updateTextFieldWithValue:self.calculator.topValue]; +} + +- (IBAction)tapDivideButton:(UIButton *)sender { + [self.calculator applyCalculatorOperator:LMSCalculatorOperatorDivide]; + [self updateTextFieldWithValue:self.calculator.topValue]; +} + +- (void)updateTextFieldWithValue: (double)value { + NSString *valueString = [self.numberFormatter stringFromNumber:@(value)]; + [self.calculatorTextField setText: valueString]; +} + +@end diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC.xcodeproj/project.pbxproj b/Sprint 12/Module 4/Contacts MRC/Contacts MRC.xcodeproj/project.pbxproj new file mode 100644 index 00000000..93917bba --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC.xcodeproj/project.pbxproj @@ -0,0 +1,402 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FFB24D70223073180096E395 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D6F223073180096E395 /* AppDelegate.m */; }; + FFB24D76223073180096E395 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFB24D74223073180096E395 /* Main.storyboard */; }; + FFB24D78223073190096E395 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FFB24D77223073190096E395 /* Assets.xcassets */; }; + FFB24D7B223073190096E395 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFB24D79223073190096E395 /* LaunchScreen.storyboard */; }; + FFB24D7E223073190096E395 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D7D223073190096E395 /* main.m */; }; + FFB24D8B223076550096E395 /* LMSContactsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D8A223076550096E395 /* LMSContactsTableViewController.m */; }; + FFB24D8E2230766E0096E395 /* LMSContactViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D8D2230766E0096E395 /* LMSContactViewController.m */; }; + FFB24D912230770D0096E395 /* LMSContact.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D902230770D0096E395 /* LMSContact.m */; }; + FFB24D94223077210096E395 /* LMSContactController.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D93223077210096E395 /* LMSContactController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FFB24D6B223073180096E395 /* Contacts MRC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Contacts MRC.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + FFB24D6E223073180096E395 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + FFB24D6F223073180096E395 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + FFB24D75223073180096E395 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FFB24D77223073190096E395 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FFB24D7A223073190096E395 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FFB24D7C223073190096E395 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFB24D7D223073190096E395 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + FFB24D89223076550096E395 /* LMSContactsTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSContactsTableViewController.h; sourceTree = ""; }; + FFB24D8A223076550096E395 /* LMSContactsTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSContactsTableViewController.m; sourceTree = ""; }; + FFB24D8C2230766E0096E395 /* LMSContactViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSContactViewController.h; sourceTree = ""; }; + FFB24D8D2230766E0096E395 /* LMSContactViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSContactViewController.m; sourceTree = ""; }; + FFB24D8F2230770D0096E395 /* LMSContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSContact.h; sourceTree = ""; }; + FFB24D902230770D0096E395 /* LMSContact.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSContact.m; sourceTree = ""; }; + FFB24D92223077210096E395 /* LMSContactController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSContactController.h; sourceTree = ""; }; + FFB24D93223077210096E395 /* LMSContactController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSContactController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FFB24D68223073180096E395 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FFB24D62223073180096E395 = { + isa = PBXGroup; + children = ( + FFB24D6D223073180096E395 /* Contacts MRC */, + FFB24D6C223073180096E395 /* Products */, + ); + sourceTree = ""; + }; + FFB24D6C223073180096E395 /* Products */ = { + isa = PBXGroup; + children = ( + FFB24D6B223073180096E395 /* Contacts MRC.app */, + ); + name = Products; + sourceTree = ""; + }; + FFB24D6D223073180096E395 /* Contacts MRC */ = { + isa = PBXGroup; + children = ( + FFB24D882230762C0096E395 /* Model */, + FFB24D87223076220096E395 /* Model Controller */, + FFB24D86223076100096E395 /* View Controllers */, + FFB24D842230739A0096E395 /* Storyboards */, + FFB24D85223073A80096E395 /* Resources */, + ); + path = "Contacts MRC"; + sourceTree = ""; + }; + FFB24D842230739A0096E395 /* Storyboards */ = { + isa = PBXGroup; + children = ( + FFB24D74223073180096E395 /* Main.storyboard */, + FFB24D79223073190096E395 /* LaunchScreen.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + FFB24D85223073A80096E395 /* Resources */ = { + isa = PBXGroup; + children = ( + FFB24D6E223073180096E395 /* AppDelegate.h */, + FFB24D6F223073180096E395 /* AppDelegate.m */, + FFB24D77223073190096E395 /* Assets.xcassets */, + FFB24D7C223073190096E395 /* Info.plist */, + FFB24D7D223073190096E395 /* main.m */, + ); + path = Resources; + sourceTree = ""; + }; + FFB24D86223076100096E395 /* View Controllers */ = { + isa = PBXGroup; + children = ( + FFB24D89223076550096E395 /* LMSContactsTableViewController.h */, + FFB24D8A223076550096E395 /* LMSContactsTableViewController.m */, + FFB24D8C2230766E0096E395 /* LMSContactViewController.h */, + FFB24D8D2230766E0096E395 /* LMSContactViewController.m */, + ); + path = "View Controllers"; + sourceTree = ""; + }; + FFB24D87223076220096E395 /* Model Controller */ = { + isa = PBXGroup; + children = ( + FFB24D92223077210096E395 /* LMSContactController.h */, + FFB24D93223077210096E395 /* LMSContactController.m */, + ); + path = "Model Controller"; + sourceTree = ""; + }; + FFB24D882230762C0096E395 /* Model */ = { + isa = PBXGroup; + children = ( + FFB24D8F2230770D0096E395 /* LMSContact.h */, + FFB24D902230770D0096E395 /* LMSContact.m */, + ); + path = Model; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FFB24D6A223073180096E395 /* Contacts MRC */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFB24D81223073190096E395 /* Build configuration list for PBXNativeTarget "Contacts MRC" */; + buildPhases = ( + FFB24D67223073180096E395 /* Sources */, + FFB24D68223073180096E395 /* Frameworks */, + FFB24D69223073180096E395 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Contacts MRC"; + productName = "Contacts MRC"; + productReference = FFB24D6B223073180096E395 /* Contacts MRC.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FFB24D63223073180096E395 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Lisa M Sampson"; + TargetAttributes = { + FFB24D6A223073180096E395 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = FFB24D66223073180096E395 /* Build configuration list for PBXProject "Contacts MRC" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FFB24D62223073180096E395; + productRefGroup = FFB24D6C223073180096E395 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FFB24D6A223073180096E395 /* Contacts MRC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FFB24D69223073180096E395 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFB24D7B223073190096E395 /* LaunchScreen.storyboard in Resources */, + FFB24D78223073190096E395 /* Assets.xcassets in Resources */, + FFB24D76223073180096E395 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FFB24D67223073180096E395 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFB24D8E2230766E0096E395 /* LMSContactViewController.m in Sources */, + FFB24D94223077210096E395 /* LMSContactController.m in Sources */, + FFB24D7E223073190096E395 /* main.m in Sources */, + FFB24D8B223076550096E395 /* LMSContactsTableViewController.m in Sources */, + FFB24D70223073180096E395 /* AppDelegate.m in Sources */, + FFB24D912230770D0096E395 /* LMSContact.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FFB24D74223073180096E395 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFB24D75223073180096E395 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FFB24D79223073190096E395 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFB24D7A223073190096E395 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FFB24D7F223073190096E395 /* 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 = NO; + 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; + }; + FFB24D80223073190096E395 /* 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 = NO; + 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; + }; + FFB24D82223073190096E395 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2LA5UAXN45; + INFOPLIST_FILE = "$(SRCROOT)/Contacts MRC/Resources/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisamsampson.Contacts-MRC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FFB24D83223073190096E395 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2LA5UAXN45; + INFOPLIST_FILE = "$(SRCROOT)/Contacts MRC/Resources/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisamsampson.Contacts-MRC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FFB24D66223073180096E395 /* Build configuration list for PBXProject "Contacts MRC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB24D7F223073190096E395 /* Debug */, + FFB24D80223073190096E395 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFB24D81223073190096E395 /* Build configuration list for PBXNativeTarget "Contacts MRC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB24D82223073190096E395 /* Debug */, + FFB24D83223073190096E395 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FFB24D63223073180096E395 /* Project object */; +} diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC.xcodeproj/xcshareddata/xcschemes/Contacts MRC.xcscheme b/Sprint 12/Module 4/Contacts MRC/Contacts MRC.xcodeproj/xcshareddata/xcschemes/Contacts MRC.xcscheme new file mode 100644 index 00000000..bb6d49c2 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC.xcodeproj/xcshareddata/xcschemes/Contacts MRC.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model Controller/LMSContactController.h b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model Controller/LMSContactController.h new file mode 100644 index 00000000..b509adff --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model Controller/LMSContactController.h @@ -0,0 +1,23 @@ +// +// LMSContactController.h +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import +#import "LMSContact.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSContactController : NSObject + +@property NSMutableArray *contacts; + +- (void)createContactWithName: (NSString *)name email: (NSString *)email andPhoneNumber: (NSString *)phoneNumber; +- (void)updateContact: (LMSContact *)contact withName: (NSString *)name email: (NSString *)email andPhoneNumber: (NSString *)phoneNumber; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model Controller/LMSContactController.m b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model Controller/LMSContactController.m new file mode 100644 index 00000000..d555c6b5 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model Controller/LMSContactController.m @@ -0,0 +1,33 @@ +// +// LMSContactController.m +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSContactController.h" + +@implementation LMSContactController + +- (instancetype)init { + self = [super init]; + if (self != nil) { + _contacts = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)createContactWithName:(NSString *)name email:(NSString *)email andPhoneNumber:(NSString *)phoneNumber { + LMSContact *contact = [[LMSContact alloc] initWithName:name email:email andPhoneNumber:phoneNumber]; + [self.contacts addObject:contact]; +} + +- (void)updateContact:(LMSContact *)contact withName:(NSString *)name email:(NSString *)email andPhoneNumber:(NSString *)phoneNumber { + NSInteger index = [[self contacts] indexOfObject:contact]; + [[self.contacts objectAtIndex:index] setName:name]; + [[self.contacts objectAtIndex:index] setEmail:email]; + [[self.contacts objectAtIndex:index] setPhoneNumber:phoneNumber]; +} + +@end diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model/LMSContact.h b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model/LMSContact.h new file mode 100644 index 00000000..a31871e1 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model/LMSContact.h @@ -0,0 +1,23 @@ +// +// LMSContact.h +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSContact : NSObject + +@property NSString *name; +@property NSString *email; +@property NSString *phoneNumber; + +- (instancetype)initWithName: (NSString *)name email: (NSString *)email andPhoneNumber: (NSString *)phoneNumber; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model/LMSContact.m b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model/LMSContact.m new file mode 100644 index 00000000..fdcf7f05 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Model/LMSContact.m @@ -0,0 +1,24 @@ +// +// LMSContact.m +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSContact.h" + +@implementation LMSContact + +- (instancetype)initWithName:(NSString *)name email:(NSString *)email andPhoneNumber:(NSString *)phoneNumber { + self = [super init]; + + if (self != nil) { + _name = name; + _email = email; + _phoneNumber = phoneNumber; + } + return self; +} + +@end diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/AppDelegate.h b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/AppDelegate.h new file mode 100644 index 00000000..2295e6ee --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/AppDelegate.m b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/AppDelegate.m new file mode 100644 index 00000000..8a2ecbea --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. 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/Contacts MRC/Contacts MRC/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/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/Contacts MRC/Contacts MRC/Resources/Assets.xcassets/Contents.json b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/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/Contacts MRC/Contacts MRC/Resources/Info.plist b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/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/Contacts MRC/Contacts MRC/Resources/main.m b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/main.m new file mode 100644 index 00000000..2fe42046 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Resources/main.m @@ -0,0 +1,16 @@ +// +// main.m +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. 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/Contacts MRC/Contacts MRC/Storyboards/Base.lproj/LaunchScreen.storyboard b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Storyboards/Base.lproj/Main.storyboard b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 00000000..ff29fc9b --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactViewController.h b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactViewController.h new file mode 100644 index 00000000..e8b8c2da --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactViewController.h @@ -0,0 +1,29 @@ +// +// LMSContactViewController.h +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import +#import "LMSContact.h" +#import "LMSContactController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSContactViewController : UIViewController + +@property LMSContact *contact; +@property LMSContactController *contactController; +@property NSString *segueIdentifier; + +@property (weak, nonatomic) IBOutlet UITextField *nameTextField; +@property (weak, nonatomic) IBOutlet UITextField *emailTextField; +@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField; + +- (IBAction)saveContact:(id)sender; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactViewController.m b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactViewController.m new file mode 100644 index 00000000..c1576453 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactViewController.m @@ -0,0 +1,65 @@ +// +// LMSContactViewController.m +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSContactViewController.h" + +@interface LMSContactViewController () + +@end + +@implementation LMSContactViewController + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + _contact = [[LMSContact alloc] init]; + _contactController = [[LMSContactController alloc] init]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + _contact = [[LMSContact alloc] init]; + _contactController = [[LMSContactController alloc] init]; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self updateViews]; + +} + +- (void)updateViews { + if (self.contact) { + self.title = self.contact.name; + self.nameTextField.text = self.contact.name; + self.emailTextField.text = self.contact.email; + self.phoneNumberTextField.text = self.contact.phoneNumber; + } +} + +- (IBAction)saveContact:(id)sender { + NSString *name = _nameTextField.text; + NSString *email = _emailTextField.text; + NSString *phoneNumber = _phoneNumberTextField.text; + + if ([_segueIdentifier isEqualToString: @"EditContact"]) { + [_contactController updateContact:_contact withName:name email:email andPhoneNumber:phoneNumber]; + } else { + [_contactController createContactWithName:name email:email andPhoneNumber:phoneNumber]; + } + + [self.navigationController popViewControllerAnimated:YES]; +} + +@end diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactsTableViewController.h b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactsTableViewController.h new file mode 100644 index 00000000..ca3da10e --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactsTableViewController.h @@ -0,0 +1,17 @@ +// +// LMSContactsTableViewController.h +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSContactsTableViewController : UITableViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactsTableViewController.m b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactsTableViewController.m new file mode 100644 index 00000000..e6bc5f95 --- /dev/null +++ b/Sprint 12/Module 4/Contacts MRC/Contacts MRC/View Controllers/LMSContactsTableViewController.m @@ -0,0 +1,75 @@ +// +// LMSContactsTableViewController.m +// Contacts MRC +// +// Created by Lisa Sampson on 3/6/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSContactsTableViewController.h" +#import "LMSContact.h" +#import "LMSContactController.h" +#import "LMSContactViewController.h" + +@interface LMSContactsTableViewController () + +@property LMSContactController *contactController; + +@end + +@implementation LMSContactsTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + _contactController = [[LMSContactController alloc] init]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:YES]; + + [self.tableView reloadData]; +} + +#pragma mark - Table view data source + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return _contactController.contacts.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell" forIndexPath:indexPath]; + + LMSContact *contact = _contactController.contacts[indexPath.row]; + cell.textLabel.text = contact.name; + cell.detailTextLabel.text = contact.phoneNumber; + + return cell; +} + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } +} +*/ + + +#pragma mark - Navigation + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + LMSContactViewController *destinationVC = [segue destinationViewController]; + destinationVC.contactController = _contactController; + destinationVC.segueIdentifier = segue.identifier; + + if ([segue.identifier isEqualToString:@"EditContact"]) { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + LMSContact *contact = _contactController.contacts[indexPath.row]; + destinationVC.contact = contact; + } +} + +@end diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC.xcodeproj/project.pbxproj b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC.xcodeproj/project.pbxproj new file mode 100644 index 00000000..5edec4e7 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC.xcodeproj/project.pbxproj @@ -0,0 +1,426 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FFB24D0C222DCED60096E395 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D0B222DCED60096E395 /* AppDelegate.m */; }; + FFB24D12222DCED60096E395 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFB24D10222DCED60096E395 /* Main.storyboard */; }; + FFB24D14222DCED70096E395 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FFB24D13222DCED70096E395 /* Assets.xcassets */; }; + FFB24D17222DCED70096E395 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFB24D15222DCED70096E395 /* LaunchScreen.storyboard */; }; + FFB24D1A222DCED70096E395 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D19222DCED70096E395 /* main.m */; }; + FFB24D28222DE0720096E395 /* PhotosCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D27222DE0720096E395 /* PhotosCollectionViewController.swift */; }; + FFB24D2A222DE0880096E395 /* PhotoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D29222DE0880096E395 /* PhotoDetailViewController.swift */; }; + FFB24D2D222DEA020096E395 /* LMSImageCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D2C222DEA020096E395 /* LMSImageCollectionViewCell.m */; }; + FFB24D36222F33E30096E395 /* LMSCache.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D35222F33E30096E395 /* LMSCache.m */; }; + FFB24D39222F34090096E395 /* LMSMarsRoverClient.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D38222F34090096E395 /* LMSMarsRoverClient.m */; }; + FFB24D3C222F34850096E395 /* LMSFetchPhotoOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = FFB24D3B222F34850096E395 /* LMSFetchPhotoOperation.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FFB24D07222DCED60096E395 /* Astronomy ObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Astronomy ObjC.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + FFB24D0A222DCED60096E395 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + FFB24D0B222DCED60096E395 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + FFB24D11222DCED60096E395 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FFB24D13222DCED70096E395 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FFB24D16222DCED70096E395 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FFB24D18222DCED70096E395 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFB24D19222DCED70096E395 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + FFB24D26222DE0720096E395 /* Astronomy ObjC-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Astronomy ObjC-Bridging-Header.h"; sourceTree = ""; }; + FFB24D27222DE0720096E395 /* PhotosCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotosCollectionViewController.swift; sourceTree = ""; }; + FFB24D29222DE0880096E395 /* PhotoDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoDetailViewController.swift; sourceTree = ""; }; + FFB24D2B222DEA020096E395 /* LMSImageCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSImageCollectionViewCell.h; sourceTree = ""; }; + FFB24D2C222DEA020096E395 /* LMSImageCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSImageCollectionViewCell.m; sourceTree = ""; }; + FFB24D34222F33E30096E395 /* LMSCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSCache.h; sourceTree = ""; }; + FFB24D35222F33E30096E395 /* LMSCache.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSCache.m; sourceTree = ""; }; + FFB24D37222F34090096E395 /* LMSMarsRoverClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSMarsRoverClient.h; sourceTree = ""; }; + FFB24D38222F34090096E395 /* LMSMarsRoverClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSMarsRoverClient.m; sourceTree = ""; }; + FFB24D3A222F34850096E395 /* LMSFetchPhotoOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMSFetchPhotoOperation.h; sourceTree = ""; }; + FFB24D3B222F34850096E395 /* LMSFetchPhotoOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMSFetchPhotoOperation.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FFB24D04222DCED60096E395 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FFB24CFE222DCED60096E395 = { + isa = PBXGroup; + children = ( + FFB24D09222DCED60096E395 /* Astronomy ObjC */, + FFB24D08222DCED60096E395 /* Products */, + ); + sourceTree = ""; + }; + FFB24D08222DCED60096E395 /* Products */ = { + isa = PBXGroup; + children = ( + FFB24D07222DCED60096E395 /* Astronomy ObjC.app */, + ); + name = Products; + sourceTree = ""; + }; + FFB24D09222DCED60096E395 /* Astronomy ObjC */ = { + isa = PBXGroup; + children = ( + FFB24D25222DD1B50096E395 /* Models */, + FFB24D24222DD1A90096E395 /* View Controllers */, + FFB24D23222DD19F0096E395 /* Views */, + FFB24D22222DD1970096E395 /* Networking */, + FFB24D21222DD1790096E395 /* Storyboards */, + FFB24D20222DD16E0096E395 /* Resources */, + ); + path = "Astronomy ObjC"; + sourceTree = ""; + }; + FFB24D20222DD16E0096E395 /* Resources */ = { + isa = PBXGroup; + children = ( + FFB24D26222DE0720096E395 /* Astronomy ObjC-Bridging-Header.h */, + FFB24D0A222DCED60096E395 /* AppDelegate.h */, + FFB24D0B222DCED60096E395 /* AppDelegate.m */, + FFB24D13222DCED70096E395 /* Assets.xcassets */, + FFB24D18222DCED70096E395 /* Info.plist */, + FFB24D19222DCED70096E395 /* main.m */, + ); + path = Resources; + sourceTree = ""; + }; + FFB24D21222DD1790096E395 /* Storyboards */ = { + isa = PBXGroup; + children = ( + FFB24D10222DCED60096E395 /* Main.storyboard */, + FFB24D15222DCED70096E395 /* LaunchScreen.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + FFB24D22222DD1970096E395 /* Networking */ = { + isa = PBXGroup; + children = ( + FFB24D37222F34090096E395 /* LMSMarsRoverClient.h */, + FFB24D38222F34090096E395 /* LMSMarsRoverClient.m */, + FFB24D3A222F34850096E395 /* LMSFetchPhotoOperation.h */, + FFB24D3B222F34850096E395 /* LMSFetchPhotoOperation.m */, + ); + path = Networking; + sourceTree = ""; + }; + FFB24D23222DD19F0096E395 /* Views */ = { + isa = PBXGroup; + children = ( + FFB24D2B222DEA020096E395 /* LMSImageCollectionViewCell.h */, + FFB24D2C222DEA020096E395 /* LMSImageCollectionViewCell.m */, + ); + path = Views; + sourceTree = ""; + }; + FFB24D24222DD1A90096E395 /* View Controllers */ = { + isa = PBXGroup; + children = ( + FFB24D27222DE0720096E395 /* PhotosCollectionViewController.swift */, + FFB24D29222DE0880096E395 /* PhotoDetailViewController.swift */, + ); + path = "View Controllers"; + sourceTree = ""; + }; + FFB24D25222DD1B50096E395 /* Models */ = { + isa = PBXGroup; + children = ( + FFB24D34222F33E30096E395 /* LMSCache.h */, + FFB24D35222F33E30096E395 /* LMSCache.m */, + ); + path = Models; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FFB24D06222DCED60096E395 /* Astronomy ObjC */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFB24D1D222DCED70096E395 /* Build configuration list for PBXNativeTarget "Astronomy ObjC" */; + buildPhases = ( + FFB24D03222DCED60096E395 /* Sources */, + FFB24D04222DCED60096E395 /* Frameworks */, + FFB24D05222DCED60096E395 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Astronomy ObjC"; + productName = "Astronomy ObjC"; + productReference = FFB24D07222DCED60096E395 /* Astronomy ObjC.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FFB24CFF222DCED60096E395 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Lisa M Sampson"; + TargetAttributes = { + FFB24D06222DCED60096E395 = { + CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1010; + }; + }; + }; + buildConfigurationList = FFB24D02222DCED60096E395 /* Build configuration list for PBXProject "Astronomy ObjC" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FFB24CFE222DCED60096E395; + productRefGroup = FFB24D08222DCED60096E395 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FFB24D06222DCED60096E395 /* Astronomy ObjC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FFB24D05222DCED60096E395 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFB24D17222DCED70096E395 /* LaunchScreen.storyboard in Resources */, + FFB24D14222DCED70096E395 /* Assets.xcassets in Resources */, + FFB24D12222DCED60096E395 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FFB24D03222DCED60096E395 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFB24D28222DE0720096E395 /* PhotosCollectionViewController.swift in Sources */, + FFB24D1A222DCED70096E395 /* main.m in Sources */, + FFB24D39222F34090096E395 /* LMSMarsRoverClient.m in Sources */, + FFB24D2A222DE0880096E395 /* PhotoDetailViewController.swift in Sources */, + FFB24D3C222F34850096E395 /* LMSFetchPhotoOperation.m in Sources */, + FFB24D0C222DCED60096E395 /* AppDelegate.m in Sources */, + FFB24D2D222DEA020096E395 /* LMSImageCollectionViewCell.m in Sources */, + FFB24D36222F33E30096E395 /* LMSCache.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FFB24D10222DCED60096E395 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFB24D11222DCED60096E395 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FFB24D15222DCED70096E395 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFB24D16222DCED70096E395 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FFB24D1B222DCED70096E395 /* 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; + }; + FFB24D1C222DCED70096E395 /* 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; + }; + FFB24D1E222DCED70096E395 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2LA5UAXN45; + INFOPLIST_FILE = "$(SRCROOT)/Astronomy ObjC/Resources/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisamsampson.Astronomy-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Astronomy ObjC/Resources/Astronomy ObjC-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FFB24D1F222DCED70096E395 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2LA5UAXN45; + INFOPLIST_FILE = "$(SRCROOT)/Astronomy ObjC/Resources/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisamsampson.Astronomy-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Astronomy ObjC/Resources/Astronomy ObjC-Bridging-Header.h"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FFB24D02222DCED60096E395 /* Build configuration list for PBXProject "Astronomy ObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB24D1B222DCED70096E395 /* Debug */, + FFB24D1C222DCED70096E395 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFB24D1D222DCED70096E395 /* Build configuration list for PBXNativeTarget "Astronomy ObjC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB24D1E222DCED70096E395 /* Debug */, + FFB24D1F222DCED70096E395 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FFB24CFF222DCED60096E395 /* Project object */; +} diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Models/LMSCache.h b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Models/LMSCache.h new file mode 100644 index 00000000..9d88160a --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Models/LMSCache.h @@ -0,0 +1,17 @@ +// +// LMSCache.h +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/5/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSCache : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Models/LMSCache.m b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Models/LMSCache.m new file mode 100644 index 00000000..06350e18 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Models/LMSCache.m @@ -0,0 +1,13 @@ +// +// LMSCache.m +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/5/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSCache.h" + +@implementation LMSCache + +@end diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSFetchPhotoOperation.h b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSFetchPhotoOperation.h new file mode 100644 index 00000000..a3207b4d --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSFetchPhotoOperation.h @@ -0,0 +1,17 @@ +// +// LMSFetchPhotoOperation.h +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/5/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSFetchPhotoOperation : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSFetchPhotoOperation.m b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSFetchPhotoOperation.m new file mode 100644 index 00000000..6379f1a4 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSFetchPhotoOperation.m @@ -0,0 +1,13 @@ +// +// LMSFetchPhotoOperation.m +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/5/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSFetchPhotoOperation.h" + +@implementation LMSFetchPhotoOperation + +@end diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSMarsRoverClient.h b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSMarsRoverClient.h new file mode 100644 index 00000000..29a1a8eb --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSMarsRoverClient.h @@ -0,0 +1,17 @@ +// +// LMSMarsRoverClient.h +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/5/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSMarsRoverClient : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSMarsRoverClient.m b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSMarsRoverClient.m new file mode 100644 index 00000000..9425c207 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Networking/LMSMarsRoverClient.m @@ -0,0 +1,13 @@ +// +// LMSMarsRoverClient.m +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/5/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSMarsRoverClient.h" + +@implementation LMSMarsRoverClient + +@end diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/AppDelegate.h b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/AppDelegate.h new file mode 100644 index 00000000..30fe46f7 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/AppDelegate.m b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/AppDelegate.m new file mode 100644 index 00000000..eca8e0ed --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. 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/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/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/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/Contents.json b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/Contents.json b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/Contents.json new file mode 100644 index 00000000..90f8aa29 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "MarsPlaceholder.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "MarsPlaceholder-1.jpg", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "MarsPlaceholder-2.jpg", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder-1.jpg b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder-1.jpg new file mode 100644 index 00000000..a43b5801 Binary files /dev/null and b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder-1.jpg differ diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder-2.jpg b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder-2.jpg new file mode 100644 index 00000000..a43b5801 Binary files /dev/null and b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder-2.jpg differ diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder.jpg b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder.jpg new file mode 100644 index 00000000..a43b5801 Binary files /dev/null and b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder.jpg differ diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Astronomy ObjC-Bridging-Header.h b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Astronomy ObjC-Bridging-Header.h new file mode 100644 index 00000000..03934a42 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Astronomy ObjC-Bridging-Header.h @@ -0,0 +1,8 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#import "LMSCache.h" +#import "LMSImageCollectionViewCell.h" +#import "LMSMarsRoverClient.h" +#import "LMSFetchPhotoOperation.h" diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Info.plist b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/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/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/main.m b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/main.m new file mode 100644 index 00000000..291b137c --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Resources/main.m @@ -0,0 +1,16 @@ +// +// main.m +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. 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/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Storyboards/Base.lproj/LaunchScreen.storyboard b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Storyboards/Base.lproj/Main.storyboard b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 00000000..c87102b9 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/View Controllers/PhotoDetailViewController.swift b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/View Controllers/PhotoDetailViewController.swift new file mode 100644 index 00000000..2f80f4e3 --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/View Controllers/PhotoDetailViewController.swift @@ -0,0 +1,21 @@ +// +// PhotoDetailViewController.swift +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +import UIKit + +class PhotoDetailViewController: UIViewController { + + @IBOutlet weak var imageView: UIImageView! + @IBOutlet weak var cameraLabel: UILabel! + @IBOutlet weak var detailLabel: UILabel! + + @IBAction func save(_ sender: Any) { + + } + +} diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/View Controllers/PhotosCollectionViewController.swift b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/View Controllers/PhotosCollectionViewController.swift new file mode 100644 index 00000000..313f82da --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/View Controllers/PhotosCollectionViewController.swift @@ -0,0 +1,27 @@ +// +// PhotosCollectionViewController.swift +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +import UIKit + +class PhotosCollectionViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + + @IBOutlet weak var collectionView: UICollectionView! + let solLabel = UILabel() + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + // TODO: - Implement + return 1 + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + // TODO: - Implement + return UICollectionViewCell() + } + + +} diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Views/LMSImageCollectionViewCell.h b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Views/LMSImageCollectionViewCell.h new file mode 100644 index 00000000..3c0d0fdc --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Views/LMSImageCollectionViewCell.h @@ -0,0 +1,19 @@ +// +// LMSImageCollectionViewCell.h +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LMSImageCollectionViewCell : UICollectionViewCell + +@property (weak, nonatomic) IBOutlet UIImageView *imageView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Views/LMSImageCollectionViewCell.m b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Views/LMSImageCollectionViewCell.m new file mode 100644 index 00000000..77e9b9fb --- /dev/null +++ b/Sprint 12/Modules 2&3/Astronomy ObjC/Astronomy ObjC/Views/LMSImageCollectionViewCell.m @@ -0,0 +1,20 @@ +// +// LMSImageCollectionViewCell.m +// Astronomy ObjC +// +// Created by Lisa Sampson on 3/4/19. +// Copyright © 2019 Lisa M Sampson. All rights reserved. +// + +#import "LMSImageCollectionViewCell.h" + +@implementation LMSImageCollectionViewCell + +- (void)prepareForReuse +{ + [super prepareForReuse]; + + self.imageView.image = [UIImage imageNamed:@"MarsPlaceholder"]; +} + +@end diff --git a/Sprint 6/Module 2-Custom Controls/Ratings/Ratings.xcodeproj/project.pbxproj b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings.xcodeproj/project.pbxproj new file mode 100644 index 00000000..e3a41bf7 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FF5A8CB02135DEBC000BA5F2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8CAF2135DEBC000BA5F2 /* AppDelegate.swift */; }; + FF5A8CB22135DEBC000BA5F2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8CB12135DEBC000BA5F2 /* ViewController.swift */; }; + FF5A8CB52135DEBC000BA5F2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8CB32135DEBC000BA5F2 /* Main.storyboard */; }; + FF5A8CB72135DEBC000BA5F2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8CB62135DEBC000BA5F2 /* Assets.xcassets */; }; + FF5A8CBA2135DEBC000BA5F2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8CB82135DEBC000BA5F2 /* LaunchScreen.storyboard */; }; + FF5A8CC22135E37A000BA5F2 /* CustomControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8CC12135E37A000BA5F2 /* CustomControl.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FF5A8CAC2135DEBC000BA5F2 /* Ratings.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ratings.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FF5A8CAF2135DEBC000BA5F2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FF5A8CB12135DEBC000BA5F2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FF5A8CB42135DEBC000BA5F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FF5A8CB62135DEBC000BA5F2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FF5A8CB92135DEBC000BA5F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FF5A8CBB2135DEBC000BA5F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FF5A8CC12135E37A000BA5F2 /* CustomControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomControl.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FF5A8CA92135DEBC000BA5F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FF5A8CA32135DEBB000BA5F2 = { + isa = PBXGroup; + children = ( + FF5A8CAE2135DEBC000BA5F2 /* Ratings */, + FF5A8CAD2135DEBC000BA5F2 /* Products */, + ); + sourceTree = ""; + }; + FF5A8CAD2135DEBC000BA5F2 /* Products */ = { + isa = PBXGroup; + children = ( + FF5A8CAC2135DEBC000BA5F2 /* Ratings.app */, + ); + name = Products; + sourceTree = ""; + }; + FF5A8CAE2135DEBC000BA5F2 /* Ratings */ = { + isa = PBXGroup; + children = ( + FF5A8CAF2135DEBC000BA5F2 /* AppDelegate.swift */, + FF5A8CB12135DEBC000BA5F2 /* ViewController.swift */, + FF5A8CB32135DEBC000BA5F2 /* Main.storyboard */, + FF5A8CB62135DEBC000BA5F2 /* Assets.xcassets */, + FF5A8CB82135DEBC000BA5F2 /* LaunchScreen.storyboard */, + FF5A8CBB2135DEBC000BA5F2 /* Info.plist */, + FF5A8CC12135E37A000BA5F2 /* CustomControl.swift */, + ); + path = Ratings; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FF5A8CAB2135DEBC000BA5F2 /* Ratings */ = { + isa = PBXNativeTarget; + buildConfigurationList = FF5A8CBE2135DEBC000BA5F2 /* Build configuration list for PBXNativeTarget "Ratings" */; + buildPhases = ( + FF5A8CA82135DEBC000BA5F2 /* Sources */, + FF5A8CA92135DEBC000BA5F2 /* Frameworks */, + FF5A8CAA2135DEBC000BA5F2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Ratings; + productName = Ratings; + productReference = FF5A8CAC2135DEBC000BA5F2 /* Ratings.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FF5A8CA42135DEBB000BA5F2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Lisa Sampson"; + TargetAttributes = { + FF5A8CAB2135DEBC000BA5F2 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = FF5A8CA72135DEBB000BA5F2 /* Build configuration list for PBXProject "Ratings" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FF5A8CA32135DEBB000BA5F2; + productRefGroup = FF5A8CAD2135DEBC000BA5F2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FF5A8CAB2135DEBC000BA5F2 /* Ratings */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FF5A8CAA2135DEBC000BA5F2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF5A8CBA2135DEBC000BA5F2 /* LaunchScreen.storyboard in Resources */, + FF5A8CB72135DEBC000BA5F2 /* Assets.xcassets in Resources */, + FF5A8CB52135DEBC000BA5F2 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FF5A8CA82135DEBC000BA5F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF5A8CB22135DEBC000BA5F2 /* ViewController.swift in Sources */, + FF5A8CC22135E37A000BA5F2 /* CustomControl.swift in Sources */, + FF5A8CB02135DEBC000BA5F2 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FF5A8CB32135DEBC000BA5F2 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FF5A8CB42135DEBC000BA5F2 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FF5A8CB82135DEBC000BA5F2 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FF5A8CB92135DEBC000BA5F2 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FF5A8CBC2135DEBC000BA5F2 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FF5A8CBD2135DEBC000BA5F2 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FF5A8CBF2135DEBC000BA5F2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Ratings/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisasampson.Ratings; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FF5A8CC02135DEBC000BA5F2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Ratings/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisasampson.Ratings; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FF5A8CA72135DEBB000BA5F2 /* Build configuration list for PBXProject "Ratings" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF5A8CBC2135DEBC000BA5F2 /* Debug */, + FF5A8CBD2135DEBC000BA5F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FF5A8CBE2135DEBC000BA5F2 /* Build configuration list for PBXNativeTarget "Ratings" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF5A8CBF2135DEBC000BA5F2 /* Debug */, + FF5A8CC02135DEBC000BA5F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FF5A8CA42135DEBB000BA5F2 /* Project object */; +} diff --git a/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/AppDelegate.swift b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/AppDelegate.swift new file mode 100644 index 00000000..2f7f5bfc --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Ratings +// +// Created by Lisa Sampson on 8/28/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: 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/Ratings/Ratings/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/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/Ratings/Ratings/Assets.xcassets/Contents.json b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/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/Ratings/Ratings/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Base.lproj/Main.storyboard b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Base.lproj/Main.storyboard new file mode 100644 index 00000000..d1942845 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Base.lproj/Main.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/CustomControl.swift b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/CustomControl.swift new file mode 100644 index 00000000..8f5521b1 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/CustomControl.swift @@ -0,0 +1,134 @@ +// +// CustomControl.swift +// Ratings +// +// Created by Lisa Sampson on 8/28/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +@IBDesignable class CustomControl: UIControl { + + required init?(coder aCoder: NSCoder) { + super.init(coder: aCoder) + + setup() + } + + func setup() { + + for index in 1...componentCount { + let x = CGFloat(index - 1)*(componentDimension + 8.0) + let newLabel = UILabel(frame: CGRect(x: x, y: 0.0, width: componentDimension, height: componentDimension)) + newLabel.tag = index + newLabel.font = UIFont.boldSystemFont(ofSize: 32.0) + newLabel.text = "✰" + newLabel.textAlignment = .center + newLabel.textColor = index == 1 ? componentActiveColor : componentInactiveColor + + addSubview(newLabel) + labels.append(newLabel) + } + + } + + 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) + } + + // MARK: - Touch Handling + + override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + updateValue(at: touch) + return true + } + + override func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + let touchPoint = touch.location(in: self) + if bounds.contains(touchPoint) { + sendActions(for: [.touchDragInside]) + updateValue(at: touch) + } else { + sendActions(for: [.touchDragOutside]) + } + return true + } + + override func endTracking(_ touch: UITouch?, with event: UIEvent?) { + guard let touch = touch else { return } + let touchPoint = touch.location(in: self) + if bounds.contains(touchPoint) { + sendActions(for: [.touchUpInside]) + updateValue(at: touch) + } else { + sendActions(for: [.touchUpOutside]) + } + } + + override func cancelTracking(with event: UIEvent?) { + sendActions(for: [.touchCancel]) + } + + func updateValue(at touch: UITouch) { + + for label in labels { + let touchPoint = touch.location(in: self) + if label.frame.contains(touchPoint) { + value = label.tag + + if value != previousValue { + previousValue = value + label.performFlare() + sendActions(for: [.valueChanged]) + } + } + } + + for label in labels { + if label.tag <= value { + label.textColor = componentActiveColor + } else { + label.textColor = componentInactiveColor + } + } + } + + + + // MARK: - Properties + + var value: Int = 1 + var previousValue: Int = 1 + var labels = [UILabel]() + + private let componentDimension: CGFloat = 40.0 + private let componentCount = 6 + private let componentActiveColor = UIColor.black + private let componentInactiveColor = UIColor.gray + +} + +extension UIView { + // "Flare view" animation sequence + func performFlare() { + func flare() { + let scaleTransform = CGAffineTransform(scaleX: 1.6, y: 1.6) + transform = scaleTransform.rotated(by: CGFloat.pi / 2) + backgroundColor = .purple + alpha = 0.5 + } + func unflare() { + transform = .identity + backgroundColor = .clear + alpha = 1.0 + } + + UIView.animate(withDuration: 0.3, + animations: { flare() }, + completion: { _ in UIView.animate(withDuration: 0.1) { unflare() }}) + } +} diff --git a/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Info.plist b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/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/Ratings/Ratings/ViewController.swift b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/ViewController.swift new file mode 100644 index 00000000..2650e3f7 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/Ratings/Ratings/ViewController.swift @@ -0,0 +1,26 @@ +// +// ViewController.swift +// Ratings +// +// Created by Lisa Sampson on 8/28/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + @IBAction func updateRating(_ ratingControl: CustomControl) { + + let rating = ratingControl.value + + if rating > 1 { + title = "User Rating: \(rating) stars" + } else { + title = "User Rating: \(rating) star" + } + + } + +} + diff --git a/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations.xcodeproj/project.pbxproj b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations.xcodeproj/project.pbxproj new file mode 100644 index 00000000..dfdcb696 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations.xcodeproj/project.pbxproj @@ -0,0 +1,337 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FF5A8D0C21372F11000BA5F2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D0B21372F11000BA5F2 /* AppDelegate.swift */; }; + FF5A8D0E21372F11000BA5F2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D0D21372F11000BA5F2 /* ViewController.swift */; }; + FF5A8D1121372F11000BA5F2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8D0F21372F11000BA5F2 /* Main.storyboard */; }; + FF5A8D1321372F12000BA5F2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8D1221372F12000BA5F2 /* Assets.xcassets */; }; + FF5A8D1621372F12000BA5F2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8D1421372F12000BA5F2 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FF5A8D0821372F11000BA5F2 /* ScatterAndGatherAnimations.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScatterAndGatherAnimations.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FF5A8D0B21372F11000BA5F2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FF5A8D0D21372F11000BA5F2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FF5A8D1021372F11000BA5F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FF5A8D1221372F12000BA5F2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FF5A8D1521372F12000BA5F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FF5A8D1721372F12000BA5F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FF5A8D0521372F11000BA5F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FF5A8CFF21372F11000BA5F2 = { + isa = PBXGroup; + children = ( + FF5A8D0A21372F11000BA5F2 /* ScatterAndGatherAnimations */, + FF5A8D0921372F11000BA5F2 /* Products */, + ); + sourceTree = ""; + }; + FF5A8D0921372F11000BA5F2 /* Products */ = { + isa = PBXGroup; + children = ( + FF5A8D0821372F11000BA5F2 /* ScatterAndGatherAnimations.app */, + ); + name = Products; + sourceTree = ""; + }; + FF5A8D0A21372F11000BA5F2 /* ScatterAndGatherAnimations */ = { + isa = PBXGroup; + children = ( + FF5A8D0B21372F11000BA5F2 /* AppDelegate.swift */, + FF5A8D0D21372F11000BA5F2 /* ViewController.swift */, + FF5A8D0F21372F11000BA5F2 /* Main.storyboard */, + FF5A8D1221372F12000BA5F2 /* Assets.xcassets */, + FF5A8D1421372F12000BA5F2 /* LaunchScreen.storyboard */, + FF5A8D1721372F12000BA5F2 /* Info.plist */, + ); + path = ScatterAndGatherAnimations; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FF5A8D0721372F11000BA5F2 /* ScatterAndGatherAnimations */ = { + isa = PBXNativeTarget; + buildConfigurationList = FF5A8D1A21372F12000BA5F2 /* Build configuration list for PBXNativeTarget "ScatterAndGatherAnimations" */; + buildPhases = ( + FF5A8D0421372F11000BA5F2 /* Sources */, + FF5A8D0521372F11000BA5F2 /* Frameworks */, + FF5A8D0621372F11000BA5F2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ScatterAndGatherAnimations; + productName = ScatterAndGatherAnimations; + productReference = FF5A8D0821372F11000BA5F2 /* ScatterAndGatherAnimations.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FF5A8D0021372F11000BA5F2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Lisa Sampson"; + TargetAttributes = { + FF5A8D0721372F11000BA5F2 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = FF5A8D0321372F11000BA5F2 /* Build configuration list for PBXProject "ScatterAndGatherAnimations" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FF5A8CFF21372F11000BA5F2; + productRefGroup = FF5A8D0921372F11000BA5F2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FF5A8D0721372F11000BA5F2 /* ScatterAndGatherAnimations */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FF5A8D0621372F11000BA5F2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF5A8D1621372F12000BA5F2 /* LaunchScreen.storyboard in Resources */, + FF5A8D1321372F12000BA5F2 /* Assets.xcassets in Resources */, + FF5A8D1121372F11000BA5F2 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FF5A8D0421372F11000BA5F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF5A8D0E21372F11000BA5F2 /* ViewController.swift in Sources */, + FF5A8D0C21372F11000BA5F2 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FF5A8D0F21372F11000BA5F2 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FF5A8D1021372F11000BA5F2 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FF5A8D1421372F12000BA5F2 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FF5A8D1521372F12000BA5F2 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FF5A8D1821372F12000BA5F2 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FF5A8D1921372F12000BA5F2 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FF5A8D1B21372F12000BA5F2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = ScatterAndGatherAnimations/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisasampson.ScatterAndGatherAnimations; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FF5A8D1C21372F12000BA5F2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = ScatterAndGatherAnimations/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisasampson.ScatterAndGatherAnimations; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FF5A8D0321372F11000BA5F2 /* Build configuration list for PBXProject "ScatterAndGatherAnimations" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF5A8D1821372F12000BA5F2 /* Debug */, + FF5A8D1921372F12000BA5F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FF5A8D1A21372F12000BA5F2 /* Build configuration list for PBXNativeTarget "ScatterAndGatherAnimations" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF5A8D1B21372F12000BA5F2 /* Debug */, + FF5A8D1C21372F12000BA5F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FF5A8D0021372F11000BA5F2 /* Project object */; +} diff --git a/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/AppDelegate.swift b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/AppDelegate.swift new file mode 100644 index 00000000..08058956 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// ScatterAndGatherAnimations +// +// Created by Lisa Sampson on 8/29/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: 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 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/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 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Contents.json b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/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 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Lambda_Logo_Full.imageset/Contents.json b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Lambda_Logo_Full.imageset/Contents.json new file mode 100644 index 00000000..473957d9 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Lambda_Logo_Full.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Lambda_Logo_Full.pdf", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf new file mode 100644 index 00000000..3a8651d4 Binary files /dev/null and b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Assets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf differ diff --git a/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Base.lproj/Main.storyboard b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Base.lproj/Main.storyboard new file mode 100644 index 00000000..335e9a04 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Base.lproj/Main.storyboard @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Info.plist b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/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 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/ViewController.swift b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/ViewController.swift new file mode 100644 index 00000000..1bd7377b --- /dev/null +++ b/Sprint 6/Module 4 - UIView Animation/ScatterAndGatherAnimations/ScatterAndGatherAnimations/ViewController.swift @@ -0,0 +1,85 @@ +// +// ViewController.swift +// ScatterAndGatherAnimations +// +// Created by Lisa Sampson on 8/29/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + labels = [lambdaL, lambdaAOne, lambdaM, lambdaB, lambdaD, lambdaATwo] + + view.addSubview(lambdaL) + view.addSubview(lambdaAOne) + view.addSubview(lambdaM) + view.addSubview(lambdaB) + view.addSubview(lambdaD) + view.addSubview(lambdaATwo) + view.addSubview(lambdaLogo) + } + + @IBAction func toggle(_ sender: Any) { + + if shouldScramble == false { + + UIView.animate(withDuration: 3.0) { + self.lambdaLogo.alpha = 0.0 + + for label in self.labels { + let index = Int(arc4random_uniform(UInt32(self.colorArray.count))) + label.textColor = self.colorArray[index] + let backgroundIndex = Int(arc4random_uniform(UInt32(self.colorArray.count))) + label.layer.backgroundColor = self.colorArray[backgroundIndex].cgColor + label.scatter() + } + } + shouldScramble = true + } else { + + UIView.animate(withDuration: 3.0) { + self.lambdaLogo.alpha = 1.0 + + for label in self.labels { + label.textColor = .black + label.layer.backgroundColor = UIColor.clear.cgColor + label.gather() + } + } + shouldScramble = false + } + } + + var shouldScramble: Bool = false + let colorArray = [UIColor.red, UIColor.orange, UIColor.blue, UIColor.cyan, UIColor.purple, UIColor.green, UIColor.magenta, UIColor.yellow] + + private var labels: [UILabel] = [] + + @IBOutlet weak var lambdaL: UILabel! + @IBOutlet weak var lambdaAOne: UILabel! + @IBOutlet weak var lambdaM: UILabel! + @IBOutlet weak var lambdaB: UILabel! + @IBOutlet weak var lambdaD: UILabel! + @IBOutlet weak var lambdaATwo: UILabel! + @IBOutlet weak var lambdaLogo: UIImageView! + +} + +extension UIView { + + func scatter() { + let translate = CGAffineTransform(translationX: CGFloat(arc4random_uniform(UInt32(superview?.bounds.width ?? 300))) - frame.minX, y: CGFloat(arc4random_uniform(UInt32(superview?.bounds.height ?? 300))) - frame.minY) + transform = translate.rotated(by: CGFloat(arc4random_uniform(361)) / CGFloat.pi*2).scaledBy(x: 1.6, y: 1.6) + } + + func gather() { + transform = .identity + } + +} + diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends.xcodeproj/project.pbxproj b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends.xcodeproj/project.pbxproj new file mode 100644 index 00000000..bb7c832f --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends.xcodeproj/project.pbxproj @@ -0,0 +1,409 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FF5A8D6C213882F1000BA5F2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D6B213882F1000BA5F2 /* AppDelegate.swift */; }; + FF5A8D71213882F1000BA5F2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8D6F213882F1000BA5F2 /* Main.storyboard */; }; + FF5A8D73213882F1000BA5F2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8D72213882F1000BA5F2 /* Assets.xcassets */; }; + FF5A8D76213882F1000BA5F2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF5A8D74213882F1000BA5F2 /* LaunchScreen.storyboard */; }; + FF5A8D8221388A49000BA5F2 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8121388A49000BA5F2 /* DetailViewController.swift */; }; + FF5A8D8421388A61000BA5F2 /* FriendsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8321388A61000BA5F2 /* FriendsTableViewController.swift */; }; + FF5A8D8621388A77000BA5F2 /* FriendsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8521388A77000BA5F2 /* FriendsTableViewCell.swift */; }; + FF5A8D8821388A87000BA5F2 /* Friend.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8721388A87000BA5F2 /* Friend.swift */; }; + FF5A8D8B2138905C000BA5F2 /* NavigationControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8A2138905C000BA5F2 /* NavigationControllerDelegate.swift */; }; + FF5A8D8E21389FFF000BA5F2 /* FriendController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8D21389FFF000BA5F2 /* FriendController.swift */; }; + FF5A8D902138A54D000BA5F2 /* ImageTransitionAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5A8D8F2138A54D000BA5F2 /* ImageTransitionAnimator.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FF5A8D68213882F1000BA5F2 /* Friends.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Friends.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FF5A8D6B213882F1000BA5F2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FF5A8D70213882F1000BA5F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FF5A8D72213882F1000BA5F2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FF5A8D75213882F1000BA5F2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FF5A8D77213882F1000BA5F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FF5A8D8121388A49000BA5F2 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; + FF5A8D8321388A61000BA5F2 /* FriendsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendsTableViewController.swift; sourceTree = ""; }; + FF5A8D8521388A77000BA5F2 /* FriendsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendsTableViewCell.swift; sourceTree = ""; }; + FF5A8D8721388A87000BA5F2 /* Friend.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Friend.swift; sourceTree = ""; }; + FF5A8D8A2138905C000BA5F2 /* NavigationControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationControllerDelegate.swift; sourceTree = ""; }; + FF5A8D8D21389FFF000BA5F2 /* FriendController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendController.swift; sourceTree = ""; }; + FF5A8D8F2138A54D000BA5F2 /* ImageTransitionAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageTransitionAnimator.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FF5A8D65213882F1000BA5F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FF5A8D5F213882F1000BA5F2 = { + isa = PBXGroup; + children = ( + FF5A8D6A213882F1000BA5F2 /* Friends */, + FF5A8D69213882F1000BA5F2 /* Products */, + ); + sourceTree = ""; + }; + FF5A8D69213882F1000BA5F2 /* Products */ = { + isa = PBXGroup; + children = ( + FF5A8D68213882F1000BA5F2 /* Friends.app */, + ); + name = Products; + sourceTree = ""; + }; + FF5A8D6A213882F1000BA5F2 /* Friends */ = { + isa = PBXGroup; + children = ( + FF5A8D892138902D000BA5F2 /* Animation */, + FF5A8D80213888C4000BA5F2 /* Model */, + FF5A8D8C21389FE0000BA5F2 /* ModelController */, + FF5A8D7F213888BA000BA5F2 /* Views */, + FF5A8D7E213888AE000BA5F2 /* ViewControllers */, + FF5A8D6B213882F1000BA5F2 /* AppDelegate.swift */, + FF5A8D7D21388896000BA5F2 /* Storyboards */, + FF5A8D72213882F1000BA5F2 /* Assets.xcassets */, + FF5A8D77213882F1000BA5F2 /* Info.plist */, + ); + path = Friends; + sourceTree = ""; + }; + FF5A8D7D21388896000BA5F2 /* Storyboards */ = { + isa = PBXGroup; + children = ( + FF5A8D6F213882F1000BA5F2 /* Main.storyboard */, + FF5A8D74213882F1000BA5F2 /* LaunchScreen.storyboard */, + ); + path = Storyboards; + sourceTree = ""; + }; + FF5A8D7E213888AE000BA5F2 /* ViewControllers */ = { + isa = PBXGroup; + children = ( + FF5A8D8121388A49000BA5F2 /* DetailViewController.swift */, + FF5A8D8321388A61000BA5F2 /* FriendsTableViewController.swift */, + ); + path = ViewControllers; + sourceTree = ""; + }; + FF5A8D7F213888BA000BA5F2 /* Views */ = { + isa = PBXGroup; + children = ( + FF5A8D8521388A77000BA5F2 /* FriendsTableViewCell.swift */, + ); + path = Views; + sourceTree = ""; + }; + FF5A8D80213888C4000BA5F2 /* Model */ = { + isa = PBXGroup; + children = ( + FF5A8D8721388A87000BA5F2 /* Friend.swift */, + ); + path = Model; + sourceTree = ""; + }; + FF5A8D892138902D000BA5F2 /* Animation */ = { + isa = PBXGroup; + children = ( + FF5A8D8A2138905C000BA5F2 /* NavigationControllerDelegate.swift */, + FF5A8D8F2138A54D000BA5F2 /* ImageTransitionAnimator.swift */, + ); + path = Animation; + sourceTree = ""; + }; + FF5A8D8C21389FE0000BA5F2 /* ModelController */ = { + isa = PBXGroup; + children = ( + FF5A8D8D21389FFF000BA5F2 /* FriendController.swift */, + ); + path = ModelController; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FF5A8D67213882F1000BA5F2 /* Friends */ = { + isa = PBXNativeTarget; + buildConfigurationList = FF5A8D7A213882F1000BA5F2 /* Build configuration list for PBXNativeTarget "Friends" */; + buildPhases = ( + FF5A8D64213882F1000BA5F2 /* Sources */, + FF5A8D65213882F1000BA5F2 /* Frameworks */, + FF5A8D66213882F1000BA5F2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Friends; + productName = Friends; + productReference = FF5A8D68213882F1000BA5F2 /* Friends.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FF5A8D60213882F1000BA5F2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Lisa Sampson"; + TargetAttributes = { + FF5A8D67213882F1000BA5F2 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = FF5A8D63213882F1000BA5F2 /* Build configuration list for PBXProject "Friends" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FF5A8D5F213882F1000BA5F2; + productRefGroup = FF5A8D69213882F1000BA5F2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FF5A8D67213882F1000BA5F2 /* Friends */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FF5A8D66213882F1000BA5F2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF5A8D76213882F1000BA5F2 /* LaunchScreen.storyboard in Resources */, + FF5A8D73213882F1000BA5F2 /* Assets.xcassets in Resources */, + FF5A8D71213882F1000BA5F2 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FF5A8D64213882F1000BA5F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FF5A8D6C213882F1000BA5F2 /* AppDelegate.swift in Sources */, + FF5A8D902138A54D000BA5F2 /* ImageTransitionAnimator.swift in Sources */, + FF5A8D8E21389FFF000BA5F2 /* FriendController.swift in Sources */, + FF5A8D8221388A49000BA5F2 /* DetailViewController.swift in Sources */, + FF5A8D8821388A87000BA5F2 /* Friend.swift in Sources */, + FF5A8D8421388A61000BA5F2 /* FriendsTableViewController.swift in Sources */, + FF5A8D8B2138905C000BA5F2 /* NavigationControllerDelegate.swift in Sources */, + FF5A8D8621388A77000BA5F2 /* FriendsTableViewCell.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FF5A8D6F213882F1000BA5F2 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FF5A8D70213882F1000BA5F2 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FF5A8D74213882F1000BA5F2 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FF5A8D75213882F1000BA5F2 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FF5A8D78213882F1000BA5F2 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FF5A8D79213882F1000BA5F2 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FF5A8D7B213882F1000BA5F2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Friends/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisasampson.Friends; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FF5A8D7C213882F1000BA5F2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Friends/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.lisasampson.Friends; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FF5A8D63213882F1000BA5F2 /* Build configuration list for PBXProject "Friends" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF5A8D78213882F1000BA5F2 /* Debug */, + FF5A8D79213882F1000BA5F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FF5A8D7A213882F1000BA5F2 /* Build configuration list for PBXNativeTarget "Friends" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FF5A8D7B213882F1000BA5F2 /* Debug */, + FF5A8D7C213882F1000BA5F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FF5A8D60213882F1000BA5F2 /* Project object */; +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Animation/ImageTransitionAnimator.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Animation/ImageTransitionAnimator.swift new file mode 100644 index 00000000..da730344 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Animation/ImageTransitionAnimator.swift @@ -0,0 +1,72 @@ +// +// ImageTransitionAnimator.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class ImageTransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning { + + func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { + return 5 + } + + func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { + + guard let toVC = transitionContext.viewController(forKey: .to) as? DetailViewController, + let toView = transitionContext.view(forKey: .to) else { return } + + let containerView = transitionContext.containerView + + let toViewEndFrame = transitionContext.finalFrame(for: toVC) + containerView.addSubview(toView) + toView.frame = toViewEndFrame + toView.alpha = 0.0 + + sourceNameLabel.alpha = 0.0 + sourceImageView.alpha = 0.0 + destinationNameLabel.alpha = 0.0 + destinationImageView.alpha = 0.0 + + let labelIntialFrame = containerView.convert(sourceNameLabel.bounds, from: sourceNameLabel) + let animatedNameLabel = UILabel(frame: labelIntialFrame) + animatedNameLabel.text = sourceNameLabel.text + animatedNameLabel.font = sourceNameLabel.font + containerView.addSubview(animatedNameLabel) + + let imageInitialFrame = containerView.convert(sourceImageView.bounds, from: sourceImageView) + let animatedImageView = UIImageView(frame: imageInitialFrame) + animatedImageView.image = sourceImageView.image + animatedImageView.contentMode = sourceImageView.contentMode + containerView.addSubview(animatedImageView) + + let duration = transitionDuration(using: transitionContext) + toView.layoutIfNeeded() + UIView.animate(withDuration: duration, animations: { + animatedNameLabel.frame = containerView.convert(self.destinationNameLabel.bounds, from: self.destinationNameLabel) + animatedImageView.frame = containerView.convert(self.destinationImageView.bounds, from: self.destinationImageView) + toView.alpha = 1.0 + }) { (success) in + + self.sourceNameLabel.alpha = 1.0 + self.sourceImageView.alpha = 1.0 + self.destinationNameLabel.alpha = 1.0 + self.destinationImageView.alpha = 1.0 + animatedNameLabel.removeFromSuperview() + animatedImageView.removeFromSuperview() + + transitionContext.completeTransition(!transitionContext.transitionWasCancelled) + + } + + } + + var sourceImageView: UIImageView! + var sourceNameLabel: UILabel! + var destinationImageView: UIImageView! + var destinationNameLabel: UILabel! + +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Animation/NavigationControllerDelegate.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Animation/NavigationControllerDelegate.swift new file mode 100644 index 00000000..3efc7f2a --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Animation/NavigationControllerDelegate.swift @@ -0,0 +1,31 @@ +// +// NavigationControllerDelegate.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + + +class NavigationControllerDelegate: NSObject, UINavigationControllerDelegate { + + func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { + + guard let toVC = toVC as? DetailViewController else { return nil } + + toVC.loadViewIfNeeded() + + animator.sourceImageView = sourceCell.cellImageView + animator.sourceNameLabel = sourceCell.nameLabel + animator.destinationImageView = toVC.imageView + animator.destinationNameLabel = toVC.nameLabel + + return animator + } + + var sourceCell: FriendsTableViewCell! + let animator = ImageTransitionAnimator() + +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/AppDelegate.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/AppDelegate.swift new file mode 100644 index 00000000..a2904112 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: 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 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/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 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/Contents.json b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/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 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/grant.imageset/Contents.json b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/grant.imageset/Contents.json new file mode 100644 index 00000000..742df766 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/grant.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "grant.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/grant.imageset/grant.jpg b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/grant.imageset/grant.jpg new file mode 100644 index 00000000..2842ccbd Binary files /dev/null and b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/grant.imageset/grant.jpg differ diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/lisaprof.imageset/Contents.json b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/lisaprof.imageset/Contents.json new file mode 100644 index 00000000..5266fed9 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/lisaprof.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "lisaprof.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/lisaprof.imageset/lisaprof.jpg b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/lisaprof.imageset/lisaprof.jpg new file mode 100644 index 00000000..f29b5057 Binary files /dev/null and b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Assets.xcassets/lisaprof.imageset/lisaprof.jpg differ diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Info.plist b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/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 4 - View Controller Transitions/Friends/Friends/Model/Friend.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Model/Friend.swift new file mode 100644 index 00000000..16d13570 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Model/Friend.swift @@ -0,0 +1,15 @@ +// +// Friend.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +struct Friend { + let name: String + let image: UIImage + let job: String +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ModelController/FriendController.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ModelController/FriendController.swift new file mode 100644 index 00000000..bcf427ec --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ModelController/FriendController.swift @@ -0,0 +1,32 @@ +// +// FriendController.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class FriendController { + + init() { + let names: [String] = ["Lisa", "Grant"] + let images: [UIImage] = [#imageLiteral(resourceName: "lisaprof"), #imageLiteral(resourceName: "grant")] + let jobs: [String] = ["iOS Student", "Senior iOS Engineer"] + + var index: Int = 0 + + for _ in names { + createFriend(withName: names[index], image: images[index], job: jobs[index]) + index += 1 + } + } + + func createFriend(withName name: String, image: UIImage, job: String) { + let friend = Friend(name: name, image: image, job: job) + friends.append(friend) + } + + var friends: [Friend] = [] +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Storyboards/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Storyboards/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Storyboards/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Storyboards/Base.lproj/Main.storyboard b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Storyboards/Base.lproj/Main.storyboard new file mode 100644 index 00000000..c8396e44 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Storyboards/Base.lproj/Main.storyboard @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ViewControllers/DetailViewController.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ViewControllers/DetailViewController.swift new file mode 100644 index 00000000..45c446a5 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ViewControllers/DetailViewController.swift @@ -0,0 +1,33 @@ +// +// DetailViewController.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class DetailViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + updateViews() + } + + func updateViews() { + guard let friend = friend else { return } + + self.title = friend.name + imageView.image = friend.image + nameLabel.text = friend.name + jobLabel.text = friend.job + } + + var friend: Friend? + + @IBOutlet weak var imageView: UIImageView! + @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var jobLabel: UILabel! +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ViewControllers/FriendsTableViewController.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ViewControllers/FriendsTableViewController.swift new file mode 100644 index 00000000..728b3123 --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/ViewControllers/FriendsTableViewController.swift @@ -0,0 +1,48 @@ +// +// FriendsTableViewController.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class FriendsTableViewController: UITableViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + navigationController?.delegate = navigationControllerDelegate + } + + // MARK: - Table view data source + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return friendController.friends.count + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "FriendCell", for: indexPath) as! FriendsTableViewCell + + cell.friend = friendController.friends[indexPath.row] + + return cell + } + + // MARK: - Navigation + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + let detailVC = segue.destination as! DetailViewController + + guard let indexPath = tableView.indexPathForSelectedRow else { return } + detailVC.friend = friendController.friends[indexPath.row] + + guard let cell = tableView.cellForRow(at: indexPath) as? FriendsTableViewCell else { return } + + navigationControllerDelegate.sourceCell = cell + } + + let friendController = FriendController() + let navigationControllerDelegate = NavigationControllerDelegate() +} diff --git a/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Views/FriendsTableViewCell.swift b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Views/FriendsTableViewCell.swift new file mode 100644 index 00000000..9ba07eac --- /dev/null +++ b/Sprint 6/Module 4 - View Controller Transitions/Friends/Friends/Views/FriendsTableViewCell.swift @@ -0,0 +1,29 @@ +// +// FriendsTableViewCell.swift +// Friends +// +// Created by Lisa Sampson on 8/30/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +class FriendsTableViewCell: UITableViewCell { + + func updateViews() { + + guard let friend = friend else { return } + nameLabel.text = friend.name + cellImageView.image = friend.image + } + + @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var cellImageView: UIImageView! + + var friend: Friend? { + didSet { + updateViews() + } + } + +} diff --git a/Sprint 7/Concurrency II (7.3)/Hungry Developers.playground/Contents.swift b/Sprint 7/Concurrency II (7.3)/Hungry Developers.playground/Contents.swift new file mode 100644 index 00000000..f1fd7938 --- /dev/null +++ b/Sprint 7/Concurrency II (7.3)/Hungry Developers.playground/Contents.swift @@ -0,0 +1,102 @@ +//: Playground - noun: a place where people can play + +import Foundation + +class Spoon { + + init(index: Int) { + self.index = index + } + + func pickUp() { + lock.lock() + } + + func putDown() { + lock.unlock() + } + + private let lock = NSLock() + let index: Int +} + +class Developer { + + init(leftSpoon: Spoon, rightSpoon: Spoon, developer: String) { + self.leftSpoon = leftSpoon + self.rightSpoon = rightSpoon + self.developer = developer + } + + func think() { + print("\(developer) is thinking.") + + if leftSpoon.index < rightSpoon.index { + + print("\(developer) is trying to pick up left spoon.") + leftSpoon.pickUp() + print("\(developer) picked up left spoon.") + + print("\(developer) is trying to pick up right spoon.") + rightSpoon.pickUp() + print("\(developer) picked up right spoon.") + } else { + + print("\(developer) is trying to pick up right spoon.") + rightSpoon.pickUp() + print("\(developer) picked up right spoon.") + + print("\(developer) is trying to pick up left spoon.") + leftSpoon.pickUp() + print("\(developer) picked up left spoon.") + } + +// let spoons = [(leftSpoon, "left"), (rightSpoon, "right")].sorted(by: { $0.0.index < $1.0.index }) +// spoons.forEach { $0.0.pickUp(); print("\(developer) picked up \($0.1) spoon.") } + } + + func eat() { + print("\(developer) is eating.") + usleep(arc4random_uniform(10) * 10000) + + print("\(developer) is trying to put down left spoon.") + leftSpoon.putDown() + print("\(developer) put down left spoon.") + + print("\(developer) is trying to put down right spoon.") + rightSpoon.putDown() + print("\(developer) put down right spoon.") + } + + func run() { + while true { + think() + eat() + } + } + + var leftSpoon: Spoon + var rightSpoon: Spoon + let developer: String +} + +// MARK: - Testing + +var spoon1 = Spoon(index: 1) +var spoon2 = Spoon(index: 2) +var spoon3 = Spoon(index: 3) +var spoon4 = Spoon(index: 4) +var spoon5 = Spoon(index: 5) + +var developer1 = Developer(leftSpoon: spoon1, rightSpoon: spoon2, developer: "Grant") +var developer2 = Developer(leftSpoon: spoon2, rightSpoon: spoon3, developer: "Lisa") +var developer3 = Developer(leftSpoon: spoon3, rightSpoon: spoon4, developer: "Krislyn") +var developer4 = Developer(leftSpoon: spoon4, rightSpoon: spoon5, developer: "Tel") +var developer5 = Developer(leftSpoon: spoon5, rightSpoon: spoon1, developer: "Mitch") + +let developers = [developer1, developer2, developer3, developer4, developer5] + +DispatchQueue.concurrentPerform(iterations: 5) { + developers[$0].run() +} + diff --git a/Sprint 7/Concurrency II (7.3)/Hungry Developers.playground/contents.xcplayground b/Sprint 7/Concurrency II (7.3)/Hungry Developers.playground/contents.xcplayground new file mode 100644 index 00000000..a93d4844 --- /dev/null +++ b/Sprint 7/Concurrency II (7.3)/Hungry Developers.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Sprint 7/Generics (7.3)/Generics Challenge.playground/Contents.swift b/Sprint 7/Generics (7.3)/Generics Challenge.playground/Contents.swift new file mode 100644 index 00000000..e6d08a5c --- /dev/null +++ b/Sprint 7/Generics (7.3)/Generics Challenge.playground/Contents.swift @@ -0,0 +1,86 @@ +//: Playground - noun: a place where people can play + +import Foundation + +struct CountedSet where Element: Hashable { + + mutating func insert(_ element: Element) { + if var valueCount = dictionary[element] { + valueCount += 1 + dictionary[element] = valueCount + } else { + dictionary[element] = 1 + } + } + + mutating func remove(_ element: Element) { + if var valueCount = dictionary[element] { + valueCount -= 1 + if valueCount == 0 { + dictionary.removeValue(forKey: element) + } else { + dictionary[element] = valueCount + } + } + } + + subscript(_ member: Element) -> Int { + return dictionary[member] ?? 0 + } + + var count: Int { + return dictionary.count + } + var isEmpty: Bool { + return dictionary.isEmpty + } + + private(set) var dictionary = [Element: Int]() +} + +extension CountedSet: ExpressibleByArrayLiteral { + init(arrayLiteral: Element...) { + for element in arrayLiteral { + self.insert(element) + } + } +} + +enum Arrow { case iron, wooden, elven, dwarvish, magic, silver } +var aCountedSet = CountedSet() + +aCountedSet[.iron] + +var myCountedSet: CountedSet = [.iron, .magic, .iron, .silver, .iron, .iron] + +myCountedSet[.iron] +myCountedSet[.magic] +myCountedSet[.dwarvish] +myCountedSet[.silver] + +myCountedSet.count + +myCountedSet.remove(.iron) +myCountedSet.remove(.dwarvish) +myCountedSet.remove(.magic) + +myCountedSet[.iron] +myCountedSet[.dwarvish] + +myCountedSet.count + +myCountedSet.remove(.magic) + +myCountedSet[.magic] + +myCountedSet.insert(.silver) +myCountedSet.insert(.wooden) +myCountedSet.insert(.elven) + +myCountedSet[.silver] +myCountedSet[.wooden] +myCountedSet[.elven] + +myCountedSet.count + + diff --git a/Sprint 7/Generics (7.3)/Generics Challenge.playground/contents.xcplayground b/Sprint 7/Generics (7.3)/Generics Challenge.playground/contents.xcplayground new file mode 100644 index 00000000..a93d4844 --- /dev/null +++ b/Sprint 7/Generics (7.3)/Generics Challenge.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift b/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift index 18a7145d..36a6fade 100644 --- a/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift +++ b/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift @@ -8,6 +8,27 @@ import UIKit +#if !swift(>=4.2) + +struct CAMediaTimingFunctionName: RawRepresentable { + let rawValue: String + + init?(rawValue: String) { + self.rawValue = rawValue + } + + static let easeIn = CAMediaTimingFunctionName(rawValue: kCAMediaTimingFunctionEaseIn)! + static let easeOut = CAMediaTimingFunctionName(rawValue: kCAMediaTimingFunctionEaseOut)! +} + +extension CAMediaTimingFunction { + convenience init(name: CAMediaTimingFunctionName) { + self.init(name: name.rawValue) + } +} + +#endif + class IndeterminateLoadingView: UIView, CAAnimationDelegate { override init(frame: CGRect) { @@ -38,7 +59,7 @@ class IndeterminateLoadingView: UIView, CAAnimationDelegate { // MARK: - Private private func setupShapeLayer() { - let thickness: CGFloat = 10.0 + let thickness: CGFloat = 13.0 shapeLayer.frame = layer.bounds shapeLayer.strokeColor = UIColor.black.cgColor @@ -102,6 +123,6 @@ class IndeterminateLoadingView: UIView, CAAnimationDelegate { private(set) var isAnimating = false private let shapeLayer = CAShapeLayer() - private let duration = 1.0 + private let duration = 1.5 private var shouldStopAnimationOnNextCycle = false } diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App.xcodeproj/project.pbxproj b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App.xcodeproj/project.pbxproj new file mode 100644 index 00000000..dcfc1262 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App.xcodeproj/project.pbxproj @@ -0,0 +1,544 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FFFCC4642152D93A00122717 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFFCC4632152D93A00122717 /* AppDelegate.swift */; }; + FFFCC4662152D93A00122717 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFFCC4652152D93A00122717 /* ViewController.swift */; }; + FFFCC4692152D93A00122717 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFFCC4672152D93A00122717 /* Main.storyboard */; }; + FFFCC46B2152D93B00122717 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FFFCC46A2152D93B00122717 /* Assets.xcassets */; }; + FFFCC46E2152D93B00122717 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFFCC46C2152D93B00122717 /* LaunchScreen.storyboard */; }; + FFFCC4792152D93B00122717 /* Loading_UI_Test_AppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFFCC4782152D93B00122717 /* Loading_UI_Test_AppTests.swift */; }; + FFFCC48F2152D9A800122717 /* Loading_UI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFFCC48E2152D9A800122717 /* Loading_UI.framework */; }; + FFFCC4902152D9A800122717 /* Loading_UI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FFFCC48E2152D9A800122717 /* Loading_UI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FFFCC4752152D93B00122717 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FFFCC4582152D93A00122717 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FFFCC45F2152D93A00122717; + remoteInfo = "Loading UI Test App"; + }; + FFFCC4962152DA9900122717 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FFFCC4832152D94700122717 /* Loading UI.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = FFFCC43C2152D8FC00122717; + remoteInfo = "Loading UI"; + }; + FFFCC4982152DA9900122717 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FFFCC4832152D94700122717 /* Loading UI.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = FFFCC4452152D8FC00122717; + remoteInfo = "Loading UITests"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + FFFCC4912152D9A800122717 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + FFFCC4902152D9A800122717 /* Loading_UI.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + FFFCC4602152D93A00122717 /* Loading UI Test App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Loading UI Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + FFFCC4632152D93A00122717 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FFFCC4652152D93A00122717 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FFFCC4682152D93A00122717 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FFFCC46A2152D93B00122717 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FFFCC46D2152D93B00122717 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FFFCC46F2152D93B00122717 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFFCC4742152D93B00122717 /* Loading UI Test AppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Loading UI Test AppTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + FFFCC4782152D93B00122717 /* Loading_UI_Test_AppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Loading_UI_Test_AppTests.swift; sourceTree = ""; }; + FFFCC47A2152D93B00122717 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFFCC4832152D94700122717 /* Loading UI.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Loading UI.xcodeproj"; path = "../../../Loading UI/Loading UI.xcodeproj"; sourceTree = ""; }; + FFFCC48E2152D9A800122717 /* Loading_UI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Loading_UI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FFFCC45D2152D93A00122717 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC48F2152D9A800122717 /* Loading_UI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FFFCC4712152D93B00122717 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FFFCC4572152D93A00122717 = { + isa = PBXGroup; + children = ( + FFFCC48E2152D9A800122717 /* Loading_UI.framework */, + FFFCC4622152D93A00122717 /* Loading UI Test App */, + FFFCC4772152D93B00122717 /* Loading UI Test AppTests */, + FFFCC4612152D93A00122717 /* Products */, + ); + sourceTree = ""; + }; + FFFCC4612152D93A00122717 /* Products */ = { + isa = PBXGroup; + children = ( + FFFCC4602152D93A00122717 /* Loading UI Test App.app */, + FFFCC4742152D93B00122717 /* Loading UI Test AppTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + FFFCC4622152D93A00122717 /* Loading UI Test App */ = { + isa = PBXGroup; + children = ( + FFFCC4632152D93A00122717 /* AppDelegate.swift */, + FFFCC4652152D93A00122717 /* ViewController.swift */, + FFFCC4672152D93A00122717 /* Main.storyboard */, + FFFCC46A2152D93B00122717 /* Assets.xcassets */, + FFFCC46C2152D93B00122717 /* LaunchScreen.storyboard */, + FFFCC46F2152D93B00122717 /* Info.plist */, + FFFCC48D2152D97A00122717 /* Frameworks */, + ); + path = "Loading UI Test App"; + sourceTree = ""; + }; + FFFCC4772152D93B00122717 /* Loading UI Test AppTests */ = { + isa = PBXGroup; + children = ( + FFFCC4782152D93B00122717 /* Loading_UI_Test_AppTests.swift */, + FFFCC47A2152D93B00122717 /* Info.plist */, + ); + path = "Loading UI Test AppTests"; + sourceTree = ""; + }; + FFFCC48D2152D97A00122717 /* Frameworks */ = { + isa = PBXGroup; + children = ( + FFFCC4832152D94700122717 /* Loading UI.xcodeproj */, + ); + path = Frameworks; + sourceTree = ""; + }; + FFFCC4922152DA9900122717 /* Products */ = { + isa = PBXGroup; + children = ( + FFFCC4972152DA9900122717 /* Loading_UI.framework */, + FFFCC4992152DA9900122717 /* Loading UITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FFFCC45F2152D93A00122717 /* Loading UI Test App */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFFCC47D2152D93B00122717 /* Build configuration list for PBXNativeTarget "Loading UI Test App" */; + buildPhases = ( + FFFCC45C2152D93A00122717 /* Sources */, + FFFCC45D2152D93A00122717 /* Frameworks */, + FFFCC45E2152D93A00122717 /* Resources */, + FFFCC4912152D9A800122717 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Loading UI Test App"; + productName = "Loading UI Test App"; + productReference = FFFCC4602152D93A00122717 /* Loading UI Test App.app */; + productType = "com.apple.product-type.application"; + }; + FFFCC4732152D93B00122717 /* Loading UI Test AppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFFCC4802152D93B00122717 /* Build configuration list for PBXNativeTarget "Loading UI Test AppTests" */; + buildPhases = ( + FFFCC4702152D93B00122717 /* Sources */, + FFFCC4712152D93B00122717 /* Frameworks */, + FFFCC4722152D93B00122717 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FFFCC4762152D93B00122717 /* PBXTargetDependency */, + ); + name = "Loading UI Test AppTests"; + productName = "Loading UI Test AppTests"; + productReference = FFFCC4742152D93B00122717 /* Loading UI Test AppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FFFCC4582152D93A00122717 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Lisa Sampson"; + TargetAttributes = { + FFFCC45F2152D93A00122717 = { + CreatedOnToolsVersion = 9.4.1; + LastSwiftMigration = 1000; + }; + FFFCC4732152D93B00122717 = { + CreatedOnToolsVersion = 9.4.1; + LastSwiftMigration = 1000; + TestTargetID = FFFCC45F2152D93A00122717; + }; + }; + }; + buildConfigurationList = FFFCC45B2152D93A00122717 /* Build configuration list for PBXProject "Loading UI Test App" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FFFCC4572152D93A00122717; + productRefGroup = FFFCC4612152D93A00122717 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = FFFCC4922152DA9900122717 /* Products */; + ProjectRef = FFFCC4832152D94700122717 /* Loading UI.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + FFFCC45F2152D93A00122717 /* Loading UI Test App */, + FFFCC4732152D93B00122717 /* Loading UI Test AppTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + FFFCC4972152DA9900122717 /* Loading_UI.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Loading_UI.framework; + remoteRef = FFFCC4962152DA9900122717 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + FFFCC4992152DA9900122717 /* Loading UITests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "Loading UITests.xctest"; + remoteRef = FFFCC4982152DA9900122717 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + FFFCC45E2152D93A00122717 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC46E2152D93B00122717 /* LaunchScreen.storyboard in Resources */, + FFFCC46B2152D93B00122717 /* Assets.xcassets in Resources */, + FFFCC4692152D93A00122717 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FFFCC4722152D93B00122717 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FFFCC45C2152D93A00122717 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC4662152D93A00122717 /* ViewController.swift in Sources */, + FFFCC4642152D93A00122717 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FFFCC4702152D93B00122717 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC4792152D93B00122717 /* Loading_UI_Test_AppTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + FFFCC4762152D93B00122717 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FFFCC45F2152D93A00122717 /* Loading UI Test App */; + targetProxy = FFFCC4752152D93B00122717 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + FFFCC4672152D93A00122717 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFFCC4682152D93A00122717 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FFFCC46C2152D93B00122717 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FFFCC46D2152D93B00122717 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FFFCC47B2152D93B00122717 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FFFCC47C2152D93B00122717 /* 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FFFCC47E2152D93B00122717 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "Loading UI Test App/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UI-Test-App"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FFFCC47F2152D93B00122717 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "Loading UI Test App/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UI-Test-App"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FFFCC4812152D93B00122717 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Loading UI Test AppTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UI-Test-AppTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Loading UI Test App.app/Loading UI Test App"; + }; + name = Debug; + }; + FFFCC4822152D93B00122717 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Loading UI Test AppTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UI-Test-AppTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Loading UI Test App.app/Loading UI Test App"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FFFCC45B2152D93A00122717 /* Build configuration list for PBXProject "Loading UI Test App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFFCC47B2152D93B00122717 /* Debug */, + FFFCC47C2152D93B00122717 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFFCC47D2152D93B00122717 /* Build configuration list for PBXNativeTarget "Loading UI Test App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFFCC47E2152D93B00122717 /* Debug */, + FFFCC47F2152D93B00122717 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFFCC4802152D93B00122717 /* Build configuration list for PBXNativeTarget "Loading UI Test AppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFFCC4812152D93B00122717 /* Debug */, + FFFCC4822152D93B00122717 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FFFCC4582152D93A00122717 /* Project object */; +} diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/AppDelegate.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/AppDelegate.swift new file mode 100644 index 00000000..4745c1a5 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Loading UI Test App +// +// Created by Lisa Sampson on 9/19/18. +// Copyright © 2018 Lisa Sampson. 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 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/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 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Assets.xcassets/Contents.json b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Base.lproj/LaunchScreen.storyboard b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Base.lproj/Main.storyboard b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Base.lproj/Main.storyboard new file mode 100644 index 00000000..5754230a --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Base.lproj/Main.storyboard @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/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 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/ViewController.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/ViewController.swift new file mode 100644 index 00000000..91cc67c6 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test App/ViewController.swift @@ -0,0 +1,27 @@ +// +// ViewController.swift +// Loading UI Test App +// +// Created by Lisa Sampson on 9/19/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit +import Loading_UI + +class ViewController: UIViewController { + + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + if segue.identifier == "ToFrameworkLoader" { + guard let destinationVC = segue.destination as? LoadingViewController else { return } + destinationVC.startAnimation() + DispatchQueue.main.asyncAfter(deadline: .now() + 10) { + destinationVC.stopAnimation() + } + DispatchQueue.main.asyncAfter(deadline: .now() + 11) { + self.dismiss(animated: true, completion: nil) + } + } + } +} + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test AppTests/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test AppTests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test AppTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test AppTests/Loading_UI_Test_AppTests.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test AppTests/Loading_UI_Test_AppTests.swift new file mode 100644 index 00000000..dddb14ea --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI Test App/Loading UI Test AppTests/Loading_UI_Test_AppTests.swift @@ -0,0 +1,36 @@ +// +// Loading_UI_Test_AppTests.swift +// Loading UI Test AppTests +// +// Created by Lisa Sampson on 9/19/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import XCTest +@testable import Loading_UI_Test_App + +class Loading_UI_Test_AppTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI.xcodeproj/project.pbxproj b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI.xcodeproj/project.pbxproj new file mode 100644 index 00000000..fda02acd --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI.xcodeproj/project.pbxproj @@ -0,0 +1,476 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FFFCC4462152D8FC00122717 /* Loading_UI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFFCC43C2152D8FC00122717 /* Loading_UI.framework */; }; + FFFCC44B2152D8FC00122717 /* Loading_UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFFCC44A2152D8FC00122717 /* Loading_UITests.swift */; }; + FFFCC44D2152D8FC00122717 /* Loading_UI.h in Headers */ = {isa = PBXBuildFile; fileRef = FFFCC43F2152D8FC00122717 /* Loading_UI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FFFCC49B2152DB1B00122717 /* LoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFFCC49A2152DB1B00122717 /* LoadingViewController.swift */; }; + FFFCC49D2152DEA700122717 /* IndeterminateLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFFCC49C2152DEA700122717 /* IndeterminateLoadingView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FFFCC4472152D8FC00122717 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FFFCC4332152D8FC00122717 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FFFCC43B2152D8FC00122717; + remoteInfo = "Loading UI"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + FFFCC43C2152D8FC00122717 /* Loading_UI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Loading_UI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FFFCC43F2152D8FC00122717 /* Loading_UI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Loading_UI.h; sourceTree = ""; }; + FFFCC4402152D8FC00122717 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFFCC4452152D8FC00122717 /* Loading UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Loading UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + FFFCC44A2152D8FC00122717 /* Loading_UITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Loading_UITests.swift; sourceTree = ""; }; + FFFCC44C2152D8FC00122717 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FFFCC49A2152DB1B00122717 /* LoadingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingViewController.swift; sourceTree = ""; }; + FFFCC49C2152DEA700122717 /* IndeterminateLoadingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IndeterminateLoadingView.swift; path = ../../../IndeterminateLoadingView.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FFFCC4382152D8FC00122717 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FFFCC4422152D8FC00122717 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC4462152D8FC00122717 /* Loading_UI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FFFCC4322152D8FC00122717 = { + isa = PBXGroup; + children = ( + FFFCC43E2152D8FC00122717 /* Loading UI */, + FFFCC4492152D8FC00122717 /* Loading UITests */, + FFFCC43D2152D8FC00122717 /* Products */, + ); + sourceTree = ""; + }; + FFFCC43D2152D8FC00122717 /* Products */ = { + isa = PBXGroup; + children = ( + FFFCC43C2152D8FC00122717 /* Loading_UI.framework */, + FFFCC4452152D8FC00122717 /* Loading UITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + FFFCC43E2152D8FC00122717 /* Loading UI */ = { + isa = PBXGroup; + children = ( + FFFCC49C2152DEA700122717 /* IndeterminateLoadingView.swift */, + FFFCC49A2152DB1B00122717 /* LoadingViewController.swift */, + FFFCC4562152D90F00122717 /* Other Sources */, + ); + path = "Loading UI"; + sourceTree = ""; + }; + FFFCC4492152D8FC00122717 /* Loading UITests */ = { + isa = PBXGroup; + children = ( + FFFCC44A2152D8FC00122717 /* Loading_UITests.swift */, + FFFCC44C2152D8FC00122717 /* Info.plist */, + ); + path = "Loading UITests"; + sourceTree = ""; + }; + FFFCC4562152D90F00122717 /* Other Sources */ = { + isa = PBXGroup; + children = ( + FFFCC43F2152D8FC00122717 /* Loading_UI.h */, + FFFCC4402152D8FC00122717 /* Info.plist */, + ); + path = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + FFFCC4392152D8FC00122717 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC44D2152D8FC00122717 /* Loading_UI.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + FFFCC43B2152D8FC00122717 /* Loading UI */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFFCC4502152D8FC00122717 /* Build configuration list for PBXNativeTarget "Loading UI" */; + buildPhases = ( + FFFCC4372152D8FC00122717 /* Sources */, + FFFCC4382152D8FC00122717 /* Frameworks */, + FFFCC4392152D8FC00122717 /* Headers */, + FFFCC43A2152D8FC00122717 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Loading UI"; + productName = "Loading UI"; + productReference = FFFCC43C2152D8FC00122717 /* Loading_UI.framework */; + productType = "com.apple.product-type.framework"; + }; + FFFCC4442152D8FC00122717 /* Loading UITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FFFCC4532152D8FC00122717 /* Build configuration list for PBXNativeTarget "Loading UITests" */; + buildPhases = ( + FFFCC4412152D8FC00122717 /* Sources */, + FFFCC4422152D8FC00122717 /* Frameworks */, + FFFCC4432152D8FC00122717 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FFFCC4482152D8FC00122717 /* PBXTargetDependency */, + ); + name = "Loading UITests"; + productName = "Loading UITests"; + productReference = FFFCC4452152D8FC00122717 /* Loading UITests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FFFCC4332152D8FC00122717 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Lisa Sampson"; + TargetAttributes = { + FFFCC43B2152D8FC00122717 = { + CreatedOnToolsVersion = 9.4.1; + LastSwiftMigration = 1000; + }; + FFFCC4442152D8FC00122717 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = FFFCC4362152D8FC00122717 /* Build configuration list for PBXProject "Loading UI" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = FFFCC4322152D8FC00122717; + productRefGroup = FFFCC43D2152D8FC00122717 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FFFCC43B2152D8FC00122717 /* Loading UI */, + FFFCC4442152D8FC00122717 /* Loading UITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FFFCC43A2152D8FC00122717 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FFFCC4432152D8FC00122717 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FFFCC4372152D8FC00122717 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC49B2152DB1B00122717 /* LoadingViewController.swift in Sources */, + FFFCC49D2152DEA700122717 /* IndeterminateLoadingView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FFFCC4412152D8FC00122717 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FFFCC44B2152D8FC00122717 /* Loading_UITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + FFFCC4482152D8FC00122717 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FFFCC43B2152D8FC00122717 /* Loading UI */; + targetProxy = FFFCC4472152D8FC00122717 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + FFFCC44E2152D8FC00122717 /* 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; + CURRENT_PROJECT_VERSION = 1; + 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + FFFCC44F2152D8FC00122717 /* 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; + CURRENT_PROJECT_VERSION = 1; + 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 = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + FFFCC4512152D8FC00122717 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Loading UI/Other Sources/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UI"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FFFCC4522152D8FC00122717 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Loading UI/Other Sources/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UI"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FFFCC4542152D8FC00122717 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Loading UITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FFFCC4552152D8FC00122717 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Loading UITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.lisasampson.Loading-UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FFFCC4362152D8FC00122717 /* Build configuration list for PBXProject "Loading UI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFFCC44E2152D8FC00122717 /* Debug */, + FFFCC44F2152D8FC00122717 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFFCC4502152D8FC00122717 /* Build configuration list for PBXNativeTarget "Loading UI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFFCC4512152D8FC00122717 /* Debug */, + FFFCC4522152D8FC00122717 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FFFCC4532152D8FC00122717 /* Build configuration list for PBXNativeTarget "Loading UITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFFCC4542152D8FC00122717 /* Debug */, + FFFCC4552152D8FC00122717 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FFFCC4332152D8FC00122717 /* Project object */; +} diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/LoadingViewController.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/LoadingViewController.swift new file mode 100644 index 00000000..38546cf2 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/LoadingViewController.swift @@ -0,0 +1,41 @@ +// +// LoadingViewController.swift +// Loading UI +// +// Created by Lisa Sampson on 9/19/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import UIKit + +public class LoadingViewController: UIViewController { + + override public func viewDidLoad() { + super.viewDidLoad() + + view.addSubview(indeterminateLoadingView) + + indeterminateLoadingView.translatesAutoresizingMaskIntoConstraints = false + + let centerY = indeterminateLoadingView.centerYAnchor.constraint(equalTo: view.centerYAnchor) + let centerX = indeterminateLoadingView.centerXAnchor.constraint(equalTo: view.centerXAnchor) + let widthConstraint = indeterminateLoadingView.widthAnchor.constraint(equalToConstant: 150) + let heightConstraint = indeterminateLoadingView.heightAnchor.constraint(equalToConstant: 150) + + NSLayoutConstraint.activate([centerY, centerX, widthConstraint, heightConstraint]) + } + + public func startAnimation() { + indeterminateLoadingView.startAnimating() + } + + public func stopAnimation() { + indeterminateLoadingView.stopAnimating() + DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { + self.indeterminateLoadingView.isHidden = true + } + } + + let indeterminateLoadingView = IndeterminateLoadingView(frame: CGRect(x: 0, y: 0, width: 150, height: 150)) + +} diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/Other Sources/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/Other Sources/Info.plist new file mode 100644 index 00000000..1007fd9d --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/Other Sources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/Other Sources/Loading_UI.h b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/Other Sources/Loading_UI.h new file mode 100644 index 00000000..0cd2f460 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UI/Other Sources/Loading_UI.h @@ -0,0 +1,19 @@ +// +// Loading_UI.h +// Loading UI +// +// Created by Lisa Sampson on 9/19/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +#import + +//! Project version number for Loading_UI. +FOUNDATION_EXPORT double Loading_UIVersionNumber; + +//! Project version string for Loading_UI. +FOUNDATION_EXPORT const unsigned char Loading_UIVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UITests/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UITests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UITests/Loading_UITests.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UITests/Loading_UITests.swift new file mode 100644 index 00000000..7c7d96c6 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/Loading UI/Loading UITests/Loading_UITests.swift @@ -0,0 +1,36 @@ +// +// Loading_UITests.swift +// Loading UITests +// +// Created by Lisa Sampson on 9/19/18. +// Copyright © 2018 Lisa Sampson. All rights reserved. +// + +import XCTest +@testable import Loading_UI + +class Loading_UITests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +}