diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc.xcodeproj/project.pbxproj b/Sprint 11/Module 4/ObjcCalc/ObjcCalc.xcodeproj/project.pbxproj new file mode 100644 index 00000000..8f04d865 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc.xcodeproj/project.pbxproj @@ -0,0 +1,385 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A5CF19EE2228984300E39209 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5CF19ED2228984300E39209 /* AppDelegate.m */; }; + A5CF19F42228984300E39209 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5CF19F22228984300E39209 /* Main.storyboard */; }; + A5CF19F62228984500E39209 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5CF19F52228984500E39209 /* Assets.xcassets */; }; + A5CF19F92228984500E39209 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5CF19F72228984500E39209 /* LaunchScreen.storyboard */; }; + A5CF19FC2228984500E39209 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A5CF19FB2228984500E39209 /* main.m */; }; + A5CF1A0422289C8B00E39209 /* OSICalculatorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5CF1A0322289C8B00E39209 /* OSICalculatorViewController.m */; }; + A5CF1A082228A19F00E39209 /* OSIStack.m in Sources */ = {isa = PBXBuildFile; fileRef = A5CF1A072228A19F00E39209 /* OSIStack.m */; }; + A5CF1A0C2228A1C800E39209 /* OSICalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = A5CF1A0B2228A1C800E39209 /* OSICalculator.m */; }; + A5CF1A0F2228A1F500E39209 /* OSIDigitAccumulator.m in Sources */ = {isa = PBXBuildFile; fileRef = A5CF1A0E2228A1F500E39209 /* OSIDigitAccumulator.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A5CF19E92228984300E39209 /* ObjcCalc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjcCalc.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A5CF19EC2228984300E39209 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + A5CF19ED2228984300E39209 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + A5CF19F32228984300E39209 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A5CF19F52228984500E39209 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A5CF19F82228984500E39209 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A5CF19FA2228984500E39209 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A5CF19FB2228984500E39209 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + A5CF1A0222289C8B00E39209 /* OSICalculatorViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSICalculatorViewController.h; sourceTree = ""; }; + A5CF1A0322289C8B00E39209 /* OSICalculatorViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSICalculatorViewController.m; sourceTree = ""; }; + A5CF1A062228A19F00E39209 /* OSIStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSIStack.h; sourceTree = ""; }; + A5CF1A072228A19F00E39209 /* OSIStack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSIStack.m; sourceTree = ""; }; + A5CF1A0A2228A1C800E39209 /* OSICalculator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSICalculator.h; sourceTree = ""; }; + A5CF1A0B2228A1C800E39209 /* OSICalculator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSICalculator.m; sourceTree = ""; }; + A5CF1A0D2228A1F500E39209 /* OSIDigitAccumulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSIDigitAccumulator.h; sourceTree = ""; }; + A5CF1A0E2228A1F500E39209 /* OSIDigitAccumulator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSIDigitAccumulator.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A5CF19E62228984300E39209 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A5CF19E02228984300E39209 = { + isa = PBXGroup; + children = ( + A5CF19EB2228984300E39209 /* ObjcCalc */, + A5CF19EA2228984300E39209 /* Products */, + ); + sourceTree = ""; + }; + A5CF19EA2228984300E39209 /* Products */ = { + isa = PBXGroup; + children = ( + A5CF19E92228984300E39209 /* ObjcCalc.app */, + ); + name = Products; + sourceTree = ""; + }; + A5CF19EB2228984300E39209 /* ObjcCalc */ = { + isa = PBXGroup; + children = ( + A5CF19EC2228984300E39209 /* AppDelegate.h */, + A5CF19ED2228984300E39209 /* AppDelegate.m */, + A5CF19F22228984300E39209 /* Main.storyboard */, + A5CF19F52228984500E39209 /* Assets.xcassets */, + A5CF1A092228A1A600E39209 /* Model */, + A5CF1A102228A22300E39209 /* Model Controller */, + A5CF1A0522289CAB00E39209 /* ViewController */, + A5CF19F72228984500E39209 /* LaunchScreen.storyboard */, + A5CF19FA2228984500E39209 /* Info.plist */, + A5CF19FB2228984500E39209 /* main.m */, + ); + path = ObjcCalc; + sourceTree = ""; + }; + A5CF1A0522289CAB00E39209 /* ViewController */ = { + isa = PBXGroup; + children = ( + A5CF1A0222289C8B00E39209 /* OSICalculatorViewController.h */, + A5CF1A0322289C8B00E39209 /* OSICalculatorViewController.m */, + ); + path = ViewController; + sourceTree = ""; + }; + A5CF1A092228A1A600E39209 /* Model */ = { + isa = PBXGroup; + children = ( + A5CF1A062228A19F00E39209 /* OSIStack.h */, + A5CF1A072228A19F00E39209 /* OSIStack.m */, + ); + path = Model; + sourceTree = ""; + }; + A5CF1A102228A22300E39209 /* Model Controller */ = { + isa = PBXGroup; + children = ( + A5CF1A0A2228A1C800E39209 /* OSICalculator.h */, + A5CF1A0B2228A1C800E39209 /* OSICalculator.m */, + A5CF1A0D2228A1F500E39209 /* OSIDigitAccumulator.h */, + A5CF1A0E2228A1F500E39209 /* OSIDigitAccumulator.m */, + ); + path = "Model Controller"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A5CF19E82228984300E39209 /* ObjcCalc */ = { + isa = PBXNativeTarget; + buildConfigurationList = A5CF19FF2228984500E39209 /* Build configuration list for PBXNativeTarget "ObjcCalc" */; + buildPhases = ( + A5CF19E52228984300E39209 /* Sources */, + A5CF19E62228984300E39209 /* Frameworks */, + A5CF19E72228984300E39209 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ObjcCalc; + productName = ObjcCalc; + productReference = A5CF19E92228984300E39209 /* ObjcCalc.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A5CF19E12228984300E39209 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = OSI; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A5CF19E82228984300E39209 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A5CF19E42228984300E39209 /* Build configuration list for PBXProject "ObjcCalc" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A5CF19E02228984300E39209; + productRefGroup = A5CF19EA2228984300E39209 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A5CF19E82228984300E39209 /* ObjcCalc */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A5CF19E72228984300E39209 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5CF19F92228984500E39209 /* LaunchScreen.storyboard in Resources */, + A5CF19F62228984500E39209 /* Assets.xcassets in Resources */, + A5CF19F42228984300E39209 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A5CF19E52228984300E39209 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5CF1A0F2228A1F500E39209 /* OSIDigitAccumulator.m in Sources */, + A5CF19FC2228984500E39209 /* main.m in Sources */, + A5CF1A0C2228A1C800E39209 /* OSICalculator.m in Sources */, + A5CF1A0422289C8B00E39209 /* OSICalculatorViewController.m in Sources */, + A5CF1A082228A19F00E39209 /* OSIStack.m in Sources */, + A5CF19EE2228984300E39209 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A5CF19F22228984300E39209 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A5CF19F32228984300E39209 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A5CF19F72228984500E39209 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A5CF19F82228984500E39209 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A5CF19FD2228984500E39209 /* 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; + }; + A5CF19FE2228984500E39209 /* 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; + }; + A5CF1A002228984500E39209 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = ObjcCalc/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.ObjcCalc; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A5CF1A012228984500E39209 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = ObjcCalc/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.ObjcCalc; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A5CF19E42228984300E39209 /* Build configuration list for PBXProject "ObjcCalc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A5CF19FD2228984500E39209 /* Debug */, + A5CF19FE2228984500E39209 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A5CF19FF2228984500E39209 /* Build configuration list for PBXNativeTarget "ObjcCalc" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A5CF1A002228984500E39209 /* Debug */, + A5CF1A012228984500E39209 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A5CF19E12228984300E39209 /* Project object */; +} diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/AppDelegate.h b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/AppDelegate.h new file mode 100644 index 00000000..afaf9cb2 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/AppDelegate.m b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/AppDelegate.m new file mode 100644 index 00000000..0b5f9080 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. 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/ObjcCalc/ObjcCalc/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/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/ObjcCalc/ObjcCalc/Assets.xcassets/Contents.json b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/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/ObjcCalc/ObjcCalc/Base.lproj/LaunchScreen.storyboard b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Base.lproj/Main.storyboard b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Base.lproj/Main.storyboard new file mode 100644 index 00000000..bfd03bc6 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Base.lproj/Main.storyboard @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Info.plist b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/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/ObjcCalc/ObjcCalc/Model Controller/OSICalculator.h b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSICalculator.h new file mode 100644 index 00000000..5545a66f --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSICalculator.h @@ -0,0 +1,30 @@ +// +// OSICalculator.h +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +typedef NS_ENUM (NSInteger, OSICalcOperators) { + OSICalcOperatorsAdd, + OSICalcOperatorsSubtract, + OSICalcOperatorsMultiply, + OSICalcOperatorsDivide +}; + +@interface OSICalculator : NSObject + +@property (readonly) double topValue; + + +- (void)pushNumber:(double)value; +- (void)applyOperator:(NSInteger)operator; +- (void)clear; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSICalculator.m b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSICalculator.m new file mode 100644 index 00000000..8dd75e83 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSICalculator.m @@ -0,0 +1,72 @@ +// +// OSICalculator.m +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSICalculator.h" +#import "OSIStack.h" + +@interface OSICalculator () +@property OSIStack *osiStack; +@property OSICalcOperators *calcOperator; +@end + +@implementation OSICalculator + +- (instancetype)init { + + self = [super init]; + if (self) { + _osiStack = [[OSIStack alloc] init]; + + } + + return self; +} +- (double) topValue { + return [[_osiStack peek] doubleValue]; +} + +- (void)pushNumber:(double)value { + NSNumber *number = [NSNumber numberWithDouble:value]; + [_osiStack push:number]; +} + +- (void)applyOperator:(NSInteger)operator { + + double result = 0.0; + double firstNumber = [[_osiStack pop] doubleValue]; + double secondNumber = [[_osiStack pop] doubleValue]; + + + + + switch (operator) { + case OSICalcOperatorsAdd: + result = firstNumber + secondNumber; + break; + case OSICalcOperatorsSubtract: + result = firstNumber - secondNumber; + break; + case OSICalcOperatorsMultiply: + result = firstNumber * secondNumber; + break; + case OSICalcOperatorsDivide: + result = firstNumber / secondNumber; + break; + + } + [_osiStack push:[NSNumber numberWithDouble:result]]; + +} + +- (void)clear { + [_osiStack pop]; +} + + + +@end diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSIDigitAccumulator.h b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSIDigitAccumulator.h new file mode 100644 index 00000000..725c220c --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSIDigitAccumulator.h @@ -0,0 +1,23 @@ +// +// OSIDigitAccumulator.h +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIDigitAccumulator : 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/ObjcCalc/ObjcCalc/Model Controller/OSIDigitAccumulator.m b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSIDigitAccumulator.m new file mode 100644 index 00000000..bda8ef97 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model Controller/OSIDigitAccumulator.m @@ -0,0 +1,52 @@ +// +// OSIDigitAccumulator.m +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIDigitAccumulator.h" + +@interface OSIDigitAccumulator () +@property NSMutableArray *digits; +@end + + +@implementation OSIDigitAccumulator + +- (instancetype)init +{ + self = [super init]; + if (self) { + _digits = [NSMutableArray arrayWithArray:@[]]; + } + return self; +} + +- (double)value { + NSString *numberAsString = [_digits componentsJoinedByString:@""]; + double number = numberAsString.doubleValue; + return number; +} + +- (void)addDigitWithNumericValue: (NSInteger)number { + + NSNumber *digit = [NSNumber numberWithInteger:number]; + NSString *digitString = digit.stringValue; + [_digits addObject:digitString]; +} + +- (void)addDecimalPoint { + if ([_digits containsObject:@"."]) { + NSLog(@"Try to add more then one DecimalPoint"); + } else { + [_digits addObject:@"."]; + } +} + +- (void)clear { + [_digits removeAllObjects]; +} + +@end diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model/OSIStack.h b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model/OSIStack.h new file mode 100644 index 00000000..4426ab10 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model/OSIStack.h @@ -0,0 +1,23 @@ +// +// OSIStack.h +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIStack : NSObject + +- (void)push:(NSNumber *)number; +- (NSNumber *)pop; +- (NSNumber *)peek; + +-(instancetype)initWithArray: (NSArray *)array; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model/OSIStack.m b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model/OSIStack.m new file mode 100644 index 00000000..6c0d1ffc --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/Model/OSIStack.m @@ -0,0 +1,45 @@ +// +// OSIStack.m +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIStack.h" + +@interface OSIStack () + +@property NSMutableArray *values; + +@end + +@implementation OSIStack + +- (instancetype)initWithArray:(NSArray *)array { + + self = [super init]; + if (self) { + _values = [array mutableCopy]; + } + return self; +} + +- (void)push:(NSNumber *)number { + [_values addObject:number]; +} + +- (NSNumber *)pop { + NSNumber *returnLastNumber = [_values lastObject]; + [_values removeLastObject]; + return returnLastNumber; +} + +- (NSNumber *)peek { + return [_values lastObject]; +} + + + + +@end diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/ViewController/OSICalculatorViewController.h b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/ViewController/OSICalculatorViewController.h new file mode 100644 index 00000000..6ecec47b --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/ViewController/OSICalculatorViewController.h @@ -0,0 +1,28 @@ +// +// OSICalculatorViewController.h +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface OSICalculatorViewController : UIViewController + +- (IBAction)numberButtonTapped:(id)sender; +- (IBAction)returnButtonTaped:(id)sender; +- (IBAction)addButtonTapped:(id)sender; +- (IBAction)subtractButtonTapped:(id)sender; +- (IBAction)multyplyButtonTapped:(id)sender; +- (IBAction)divideButtonTapped:(id)sender; +- (IBAction)decimalButtonTapped:(id)sender; +@property (weak, nonatomic) IBOutlet UITextField *textField; + +@property NSNumberFormatter *numberFormater; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/ViewController/OSICalculatorViewController.m b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/ViewController/OSICalculatorViewController.m new file mode 100644 index 00000000..bfd74172 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/ViewController/OSICalculatorViewController.m @@ -0,0 +1,78 @@ +// +// OSICalculatorViewController.m +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSICalculatorViewController.h" +#import "OSICalculator.h" +#import "OSIDigitAccumulator.h" + +@interface OSICalculatorViewController () +@property OSICalculator *osiCalculator; +@property OSIDigitAccumulator *osiDigitAccumulator; +@end + +@implementation OSICalculatorViewController + + + + +- (void)viewDidLoad { + [super viewDidLoad]; + _osiCalculator = [[OSICalculator alloc] init]; + _osiDigitAccumulator = [[OSIDigitAccumulator alloc] init]; + _numberFormater = [[NSNumberFormatter alloc] init]; + + _numberFormater.allowsFloats = YES; + _numberFormater.maximumIntegerDigits = 20; + _numberFormater.minimumFractionDigits = 0; + _numberFormater.maximumFractionDigits = 20; +} + +- (void)updateTextFieldWithValue: (double)value { + NSString *valueString = [self.numberFormater stringFromNumber:@(value)]; + [_textField setText: valueString]; +} + +- (IBAction)numberButtonTapped:(id)sender { + double number = [sender tag]; + [_osiDigitAccumulator addDigitWithNumericValue:number]; + [self updateTextFieldWithValue:_osiDigitAccumulator.value]; +} + +- (IBAction)returnButtonTaped:(id)sender { + + double value = self.osiDigitAccumulator.value; + [_osiCalculator pushNumber:value]; + [_osiDigitAccumulator clear]; + [self updateTextFieldWithValue:_osiDigitAccumulator.value]; +} + +- (IBAction)addButtonTapped:(id)sender { + [_osiCalculator applyOperator: OSICalcOperatorsAdd]; + [self updateTextFieldWithValue:_osiCalculator.topValue]; +} + +- (IBAction)subtractButtonTapped:(id)sender { + [_osiCalculator applyOperator:OSICalcOperatorsSubtract]; + [self updateTextFieldWithValue:_osiCalculator.topValue]; +} + +- (IBAction)multyplyButtonTapped:(id)sender { + [_osiCalculator applyOperator:OSICalcOperatorsMultiply]; + [self updateTextFieldWithValue:_osiCalculator.topValue]; +} + +- (IBAction)divideButtonTapped:(id)sender { + [_osiCalculator applyOperator:OSICalcOperatorsDivide]; + [self updateTextFieldWithValue:_osiCalculator.topValue]; +} + +- (IBAction)decimalButtonTapped:(id)sender { + [self.osiDigitAccumulator addDecimalPoint]; + [self updateTextFieldWithValue:self.osiDigitAccumulator.value]; +} +@end diff --git a/Sprint 11/Module 4/ObjcCalc/ObjcCalc/main.m b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/main.m new file mode 100644 index 00000000..d1cb0a00 --- /dev/null +++ b/Sprint 11/Module 4/ObjcCalc/ObjcCalc/main.m @@ -0,0 +1,16 @@ +// +// main.m +// ObjcCalc +// +// Created by Sergey Osipyan on 2/28/19. +// Copyright © 2019 Sergey Osipyan. 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/ObjcMRC/ObjcMRC.xcodeproj/project.pbxproj b/Sprint 12/Module 4/ObjcMRC/ObjcMRC.xcodeproj/project.pbxproj new file mode 100644 index 00000000..2f64e833 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC.xcodeproj/project.pbxproj @@ -0,0 +1,385 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A5B556F62230662D00EFBAC7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5B556F52230662D00EFBAC7 /* AppDelegate.m */; }; + A5B556FC2230662D00EFBAC7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5B556FA2230662D00EFBAC7 /* Main.storyboard */; }; + A5B556FE2230662F00EFBAC7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B556FD2230662F00EFBAC7 /* Assets.xcassets */; }; + A5B557012230662F00EFBAC7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5B556FF2230662F00EFBAC7 /* LaunchScreen.storyboard */; }; + A5B557042230662F00EFBAC7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A5B557032230662F00EFBAC7 /* main.m */; }; + A5B5570F223067A800EFBAC7 /* OSIContactTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5B5570B223067A800EFBAC7 /* OSIContactTableViewController.m */; }; + A5B55710223067A800EFBAC7 /* OSIContactDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5B5570D223067A800EFBAC7 /* OSIContactDetailViewController.m */; }; + A5B557162230680800EFBAC7 /* OSIContact.m in Sources */ = {isa = PBXBuildFile; fileRef = A5B557152230680800EFBAC7 /* OSIContact.m */; }; + A5B5571A2230684400EFBAC7 /* OSIContactController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5B557192230684400EFBAC7 /* OSIContactController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A5B556F12230662D00EFBAC7 /* ObjcMRC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjcMRC.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A5B556F42230662D00EFBAC7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + A5B556F52230662D00EFBAC7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + A5B556FB2230662D00EFBAC7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A5B556FD2230662F00EFBAC7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A5B557002230662F00EFBAC7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A5B557022230662F00EFBAC7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A5B557032230662F00EFBAC7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + A5B5570B223067A800EFBAC7 /* OSIContactTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OSIContactTableViewController.m; sourceTree = ""; }; + A5B5570C223067A800EFBAC7 /* OSIContactDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSIContactDetailViewController.h; sourceTree = ""; }; + A5B5570D223067A800EFBAC7 /* OSIContactDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OSIContactDetailViewController.m; sourceTree = ""; }; + A5B5570E223067A800EFBAC7 /* OSIContactTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSIContactTableViewController.h; sourceTree = ""; }; + A5B557142230680800EFBAC7 /* OSIContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSIContact.h; sourceTree = ""; }; + A5B557152230680800EFBAC7 /* OSIContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OSIContact.m; sourceTree = ""; }; + A5B557182230684400EFBAC7 /* OSIContactController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSIContactController.h; sourceTree = ""; }; + A5B557192230684400EFBAC7 /* OSIContactController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OSIContactController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A5B556EE2230662D00EFBAC7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A5B556E82230662D00EFBAC7 = { + isa = PBXGroup; + children = ( + A5B556F32230662D00EFBAC7 /* ObjcMRC */, + A5B556F22230662D00EFBAC7 /* Products */, + ); + sourceTree = ""; + }; + A5B556F22230662D00EFBAC7 /* Products */ = { + isa = PBXGroup; + children = ( + A5B556F12230662D00EFBAC7 /* ObjcMRC.app */, + ); + name = Products; + sourceTree = ""; + }; + A5B556F32230662D00EFBAC7 /* ObjcMRC */ = { + isa = PBXGroup; + children = ( + A5B556F42230662D00EFBAC7 /* AppDelegate.h */, + A5B556F52230662D00EFBAC7 /* AppDelegate.m */, + A5B55713223067FA00EFBAC7 /* Model */, + A5B557172230682D00EFBAC7 /* Model Controller */, + A5B5570A2230668000EFBAC7 /* View Controller */, + A5B556FA2230662D00EFBAC7 /* Main.storyboard */, + A5B556FD2230662F00EFBAC7 /* Assets.xcassets */, + A5B556FF2230662F00EFBAC7 /* LaunchScreen.storyboard */, + A5B557022230662F00EFBAC7 /* Info.plist */, + A5B557032230662F00EFBAC7 /* main.m */, + ); + path = ObjcMRC; + sourceTree = ""; + }; + A5B5570A2230668000EFBAC7 /* View Controller */ = { + isa = PBXGroup; + children = ( + A5B5570C223067A800EFBAC7 /* OSIContactDetailViewController.h */, + A5B5570D223067A800EFBAC7 /* OSIContactDetailViewController.m */, + A5B5570E223067A800EFBAC7 /* OSIContactTableViewController.h */, + A5B5570B223067A800EFBAC7 /* OSIContactTableViewController.m */, + ); + path = "View Controller"; + sourceTree = ""; + }; + A5B55713223067FA00EFBAC7 /* Model */ = { + isa = PBXGroup; + children = ( + A5B557142230680800EFBAC7 /* OSIContact.h */, + A5B557152230680800EFBAC7 /* OSIContact.m */, + ); + name = Model; + path = "New Group"; + sourceTree = ""; + }; + A5B557172230682D00EFBAC7 /* Model Controller */ = { + isa = PBXGroup; + children = ( + A5B557182230684400EFBAC7 /* OSIContactController.h */, + A5B557192230684400EFBAC7 /* OSIContactController.m */, + ); + path = "Model Controller"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A5B556F02230662D00EFBAC7 /* ObjcMRC */ = { + isa = PBXNativeTarget; + buildConfigurationList = A5B557072230662F00EFBAC7 /* Build configuration list for PBXNativeTarget "ObjcMRC" */; + buildPhases = ( + A5B556ED2230662D00EFBAC7 /* Sources */, + A5B556EE2230662D00EFBAC7 /* Frameworks */, + A5B556EF2230662D00EFBAC7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ObjcMRC; + productName = ObjcMRC; + productReference = A5B556F12230662D00EFBAC7 /* ObjcMRC.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A5B556E92230662D00EFBAC7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A5B556F02230662D00EFBAC7 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A5B556EC2230662D00EFBAC7 /* Build configuration list for PBXProject "ObjcMRC" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A5B556E82230662D00EFBAC7; + productRefGroup = A5B556F22230662D00EFBAC7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A5B556F02230662D00EFBAC7 /* ObjcMRC */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A5B556EF2230662D00EFBAC7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5B557012230662F00EFBAC7 /* LaunchScreen.storyboard in Resources */, + A5B556FE2230662F00EFBAC7 /* Assets.xcassets in Resources */, + A5B556FC2230662D00EFBAC7 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A5B556ED2230662D00EFBAC7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5B5571A2230684400EFBAC7 /* OSIContactController.m in Sources */, + A5B557162230680800EFBAC7 /* OSIContact.m in Sources */, + A5B5570F223067A800EFBAC7 /* OSIContactTableViewController.m in Sources */, + A5B55710223067A800EFBAC7 /* OSIContactDetailViewController.m in Sources */, + A5B557042230662F00EFBAC7 /* main.m in Sources */, + A5B556F62230662D00EFBAC7 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A5B556FA2230662D00EFBAC7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A5B556FB2230662D00EFBAC7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A5B556FF2230662F00EFBAC7 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A5B557002230662F00EFBAC7 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A5B557052230662F00EFBAC7 /* 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; + }; + A5B557062230662F00EFBAC7 /* 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; + }; + A5B557082230662F00EFBAC7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = ObjcMRC/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.ObjcMRC; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A5B557092230662F00EFBAC7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = ObjcMRC/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.ObjcMRC; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A5B556EC2230662D00EFBAC7 /* Build configuration list for PBXProject "ObjcMRC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A5B557052230662F00EFBAC7 /* Debug */, + A5B557062230662F00EFBAC7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A5B557072230662F00EFBAC7 /* Build configuration list for PBXNativeTarget "ObjcMRC" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A5B557082230662F00EFBAC7 /* Debug */, + A5B557092230662F00EFBAC7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A5B556E92230662D00EFBAC7 /* Project object */; +} diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC.xcodeproj/xcshareddata/xcschemes/ObjcMRC.xcscheme b/Sprint 12/Module 4/ObjcMRC/ObjcMRC.xcodeproj/xcshareddata/xcschemes/ObjcMRC.xcscheme new file mode 100644 index 00000000..d98353d5 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC.xcodeproj/xcshareddata/xcschemes/ObjcMRC.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/AppDelegate.h b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/AppDelegate.h new file mode 100644 index 00000000..4f616756 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// ObjcMRC +// +// Created by Sergey Osipyan on 3/6/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/AppDelegate.m b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/AppDelegate.m new file mode 100644 index 00000000..e8a6fe2b --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// ObjcMRC +// +// Created by Sergey Osipyan on 3/6/19. +// Copyright © 2019 Sergey Osipyan. 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/ObjcMRC/ObjcMRC/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/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/ObjcMRC/ObjcMRC/Assets.xcassets/Contents.json b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/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/ObjcMRC/ObjcMRC/Base.lproj/LaunchScreen.storyboard b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Base.lproj/Main.storyboard b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Base.lproj/Main.storyboard new file mode 100644 index 00000000..b15274b2 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Base.lproj/Main.storyboard @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Info.plist b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/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/ObjcMRC/ObjcMRC/Model Controller/OSIContactController.h b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Model Controller/OSIContactController.h new file mode 100644 index 00000000..6f331876 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Model Controller/OSIContactController.h @@ -0,0 +1,25 @@ +// +// OSISongController.h +// Sprint11 +// +// Created by Sergey Osipyan on 3/1/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import +#import "OSIContact.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIContactController : NSObject + +@property (retain) NSMutableArray *contacts; + + +-(void)createContact:(NSString*)firstName lastName:(NSString*)lastname emailAddress:(NSString*)emailAddress phoneNumber:(NSString *)phoneNumber; + +-(void)updateContact:(OSIContact *)conatct firstName:(NSString*)firstName lastName:(NSString*)lastName emailAddress:(NSString*)emailAddress phoneNumber:(NSString *)phoneNumber; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Model Controller/OSIContactController.m b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Model Controller/OSIContactController.m new file mode 100644 index 00000000..0f3ed385 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/Model Controller/OSIContactController.m @@ -0,0 +1,49 @@ +// +// OSISongController.m +// Sprint11 +// +// Created by Sergey Osipyan on 3/1/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIContactController.h" +#import "OSIContact.h" + + +@implementation OSIContactController + + +- (instancetype)init { + self = [super init]; + if (self) { + _contacts = [[NSMutableArray alloc] init]; + + // [_contacts autorelease]; + } + return self; +} + +-(void)createContact:(NSString*)firstName lastName:(NSString*)lastName emailAddress:(NSString*)emailAddress phoneNumber:(NSString *)phoneNumber { + + OSIContact *contact = [[OSIContact alloc] initWithName:firstName lastName:lastName emailAddress:emailAddress phoneNumber:phoneNumber]; + [[self contacts] addObject:contact]; + [contact release]; +} + +-(void)updateContact:(OSIContact *)conatct firstName:(NSString*)firstName lastName:(NSString*)lastname emailAddress:(NSString*)emailAddress phoneNumber:(NSString *)phoneNumber { + + conatct.lastName = lastname; + conatct.firstName = firstName; + conatct.emailAddress = emailAddress; + conatct.phoneNumber = phoneNumber; + +} + +- (void)dealloc +{ + [_contacts release]; + [super dealloc]; +} + + +@end diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/New Group/OSIContact.h b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/New Group/OSIContact.h new file mode 100644 index 00000000..490f52ca --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/New Group/OSIContact.h @@ -0,0 +1,17 @@ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIContact : NSObject + +@property (nonatomic, copy) NSString *firstName; +@property (nonatomic, copy) NSString *lastName; +@property (nonatomic, copy) NSString *emailAddress; +@property (nonatomic, copy) NSString *phoneNumber; + +- (instancetype)initWithName:(NSString *)firstName lastName:(NSString *)lastName emailAddress:(NSString *)emailAddress phoneNumber:(NSString *)phoneNumber; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/New Group/OSIContact.m b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/New Group/OSIContact.m new file mode 100644 index 00000000..f3914e06 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/New Group/OSIContact.m @@ -0,0 +1,33 @@ +// +// OSISong.m +// Sprint11 +// +// Created by Sergey Osipyan on 3/1/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIContact.h" + +@implementation OSIContact + +- (instancetype)initWithName:(NSString *)firstName lastName:(NSString *)lastName emailAddress:(NSString *)emailAddress phoneNumber:(NSString *)phoneNumber { + + self = [super init]; + if (self) { + _firstName = firstName; + _lastName = lastName; + _emailAddress = emailAddress; + _phoneNumber = phoneNumber; + + } + return self; +} + +-(void)dealloc{ + [_firstName release]; + [_lastName release]; + [_emailAddress release]; + [_phoneNumber release]; + [super dealloc]; +} +@end diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactDetailViewController.h b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactDetailViewController.h new file mode 100644 index 00000000..8659a7bc --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactDetailViewController.h @@ -0,0 +1,21 @@ +// +// OSISongDetailViewController.h +// Sprint11 +// +// Created by Sergey Osipyan on 3/1/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import +#import "OSIContact.h" +#import "OSIContactController.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIContactDetailViewController : UIViewController +@property (retain, nullable) OSIContact *conatct; +@property (retain) OSIContactController *osiContactController; +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactDetailViewController.m b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactDetailViewController.m new file mode 100644 index 00000000..7648c7e0 --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactDetailViewController.m @@ -0,0 +1,87 @@ + +#import "OSIContactDetailViewController.h" +#import "OSIContactController.h" +#import "OSIContact.h" + +@interface OSIContactDetailViewController () + + +@property (retain, nonatomic) IBOutlet UITextField *firstNameTextField; +@property (retain, nonatomic) IBOutlet UITextField *lastNameTextField; +@property (retain, nonatomic) IBOutlet UITextField *emailAddressTextFiled; +@property (retain, nonatomic) IBOutlet UITextField *phoneNumberTextFiled; +@property (retain, nonatomic) IBOutlet UITextView *textBodyTextView; + +- (IBAction)saveButton:(id)sender; + + +@end + +@implementation OSIContactDetailViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [self updateViews]; + + +} + + +- (void)saveButton:(id)sender { + if (!self.conatct && (self.firstNameTextField.text.length > 0)) { + NSString *firstName = self.firstNameTextField.text; + NSString *lastName = self.lastNameTextField.text; + NSString *emailAddress = self.emailAddressTextFiled.text; + NSString *phoneNumber = self.phoneNumberTextFiled.text; + + [_osiContactController createContact:firstName lastName:lastName emailAddress:emailAddress phoneNumber:phoneNumber]; + + } else { + + NSString *firstName = self.firstNameTextField.text; + NSString *lastName = self.lastNameTextField.text; + NSString *emailAddress = self.emailAddressTextFiled.text; + NSString *phoneNumber = self.phoneNumberTextFiled.text; + + [_osiContactController updateContact:self.conatct firstName:firstName lastName:lastName emailAddress:emailAddress phoneNumber:phoneNumber]; + + } + [self.navigationController popViewControllerAnimated:YES]; + +} + + +- (void)updateViews { + if (self.isViewLoaded == NO) { return ;} + + if (self.conatct == nil) { + self.title = @"Add New Contact"; + + self.firstNameTextField.text = @""; + self.textBodyTextView.text = @""; + self.lastNameTextField.text = @""; + self.emailAddressTextFiled.text = @""; + self.phoneNumberTextFiled.text = @""; + } else { + self.title = _conatct.firstName; + self.firstNameTextField.text = _conatct.firstName; + self.textBodyTextView.text = @""; + self.lastNameTextField.text = _conatct.lastName; + self.emailAddressTextFiled.text = _conatct.emailAddress; + self.phoneNumberTextFiled.text = _conatct.phoneNumber; + } +} + +- (void)dealloc { + [_firstNameTextField release]; + [_lastNameTextField release]; + [_emailAddressTextFiled release]; + [_phoneNumberTextFiled release]; + [_conatct release]; + [_osiContactController release]; + [_textBodyTextView release]; + [super dealloc]; +} + + +@end diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactTableViewController.h b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactTableViewController.h new file mode 100644 index 00000000..61f9630e --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactTableViewController.h @@ -0,0 +1,17 @@ +// +// OSISongTableViewController.h +// Sprint11 +// +// Created by Sergey Osipyan on 3/1/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIContactTableViewController : UITableViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactTableViewController.m b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactTableViewController.m new file mode 100644 index 00000000..ac2d8dec --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/View Controller/OSIContactTableViewController.m @@ -0,0 +1,116 @@ +// +// OSISongTableViewController.m +// Sprint11 +// +// Created by Sergey Osipyan on 3/1/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIContactTableViewController.h" +#import "OSIContactController.h" +#import "OSIContact.h" +#import "OSIContactDetailViewController.h" + +@interface OSIContactTableViewController () +- (IBAction)addButton:(id)sender; +@property (retain) OSIContactController *osiContactController; +@end + +@implementation OSIContactTableViewController + + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]; + if (self) { + _osiContactController = [[OSIContactController alloc] init]; + //[_osiContactController autorelease]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder: aDecoder]; + if (self) { + _osiContactController = [[OSIContactController alloc] init]; + // [_osiContactController autorelease]; + } + return self; +} + + +- (void)addButton:(id)sender { + +} + +static NSString * const reuseIdentifier = @"contactCell"; + +- (void)viewDidLoad { + [super viewDidLoad]; + [[self tableView] reloadData]; +} + + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [[self tableView] reloadData]; +} + + + +//#pragma mark - Table view data source + + + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +//#warning Incomplete implementation, return the number of rows + return [[_osiContactController contacts] count]; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath]; + OSIContact *contact = [[_osiContactController contacts] objectAtIndex:indexPath.row]; + cell.textLabel.text = contact.firstName; + cell.detailTextLabel.text = contact.lastName; + + + return cell; +} + + + + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + + OSIContact *contact = [self.osiContactController.contacts objectAtIndex:indexPath.row]; + [self.osiContactController.contacts removeObject:contact]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + } +} + + + + + +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + OSIContactDetailViewController * destination = segue.destinationViewController; + destination.osiContactController = self.osiContactController; + if ([segue.identifier isEqual: @"showCell"]) { + + destination.conatct = [[self.osiContactController contacts] objectAtIndex:indexPath.row]; + } +} + +- (void)dealloc +{ + [_osiContactController release]; + [super dealloc]; +} + +@end diff --git a/Sprint 12/Module 4/ObjcMRC/ObjcMRC/main.m b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/main.m new file mode 100644 index 00000000..ca6cbc1b --- /dev/null +++ b/Sprint 12/Module 4/ObjcMRC/ObjcMRC/main.m @@ -0,0 +1,16 @@ +// +// main.m +// ObjcMRC +// +// Created by Sergey Osipyan on 3/6/19. +// Copyright © 2019 Sergey Osipyan. 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/Objc Mars Rover/Objc Mars Rover.xcodeproj/project.pbxproj b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover.xcodeproj/project.pbxproj new file mode 100644 index 00000000..77b4a8c2 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover.xcodeproj/project.pbxproj @@ -0,0 +1,431 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A52D26B9222DCC8C00038CF5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A52D26B8222DCC8C00038CF5 /* AppDelegate.m */; }; + A52D26BF222DCC8C00038CF5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52D26BD222DCC8C00038CF5 /* Main.storyboard */; }; + A52D26C1222DCC8D00038CF5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A52D26C0222DCC8D00038CF5 /* Assets.xcassets */; }; + A52D26C4222DCC8D00038CF5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52D26C2222DCC8D00038CF5 /* LaunchScreen.storyboard */; }; + A52D26C7222DCC8D00038CF5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A52D26C6222DCC8D00038CF5 /* main.m */; }; + A52D26CF222DCF7000038CF5 /* OSIMarsRoverClient.m in Sources */ = {isa = PBXBuildFile; fileRef = A52D26CE222DCF7000038CF5 /* OSIMarsRoverClient.m */; }; + A52D26D8222DD2DB00038CF5 /* OSIModelController.m in Sources */ = {isa = PBXBuildFile; fileRef = A52D26D7222DD2DB00038CF5 /* OSIModelController.m */; }; + A52D26DC222DD34D00038CF5 /* OSIMarsRover.m in Sources */ = {isa = PBXBuildFile; fileRef = A52D26DB222DD34D00038CF5 /* OSIMarsRover.m */; }; + A52D26E2222DD6B700038CF5 /* PhotoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52D26E0222DD6B700038CF5 /* PhotoDetailViewController.swift */; }; + A52D26E3222DD6B700038CF5 /* PhotosCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52D26E1222DD6B700038CF5 /* PhotosCollectionViewController.swift */; }; + A52D26E5222DED6400038CF5 /* OSIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52D26E4222DED6400038CF5 /* OSIViewController.swift */; }; + A577FDDF2231C053000FC4A1 /* OSIMarsRoverPhoto.m in Sources */ = {isa = PBXBuildFile; fileRef = A577FDDE2231C053000FC4A1 /* OSIMarsRoverPhoto.m */; }; + A577FDE12231CF60000FC4A1 /* URL+Secure.swift in Sources */ = {isa = PBXBuildFile; fileRef = A577FDE02231CF60000FC4A1 /* URL+Secure.swift */; }; + A5B556E3222F465900EFBAC7 /* ImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B556E2222F465900EFBAC7 /* ImageCollectionViewCell.swift */; }; + A5B556E6222F9BDB00EFBAC7 /* MarsPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B556E4222F9BDB00EFBAC7 /* MarsPhoto.swift */; }; + A5B556E7222F9BDB00EFBAC7 /* Camera.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B556E5222F9BDB00EFBAC7 /* Camera.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A52D26B4222DCC8C00038CF5 /* Objc Mars Rover.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Objc Mars Rover.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + A52D26B7222DCC8C00038CF5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + A52D26B8222DCC8C00038CF5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + A52D26BE222DCC8C00038CF5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A52D26C0222DCC8D00038CF5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A52D26C3222DCC8D00038CF5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A52D26C5222DCC8D00038CF5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A52D26C6222DCC8D00038CF5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + A52D26CD222DCF7000038CF5 /* OSIMarsRoverClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSIMarsRoverClient.h; sourceTree = ""; }; + A52D26CE222DCF7000038CF5 /* OSIMarsRoverClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSIMarsRoverClient.m; sourceTree = ""; }; + A52D26D6222DD2DB00038CF5 /* OSIModelController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSIModelController.h; sourceTree = ""; }; + A52D26D7222DD2DB00038CF5 /* OSIModelController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSIModelController.m; sourceTree = ""; }; + A52D26DA222DD34D00038CF5 /* OSIMarsRover.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSIMarsRover.h; sourceTree = ""; }; + A52D26DB222DD34D00038CF5 /* OSIMarsRover.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSIMarsRover.m; sourceTree = ""; }; + A52D26DD222DD60000038CF5 /* Objc Mars Rover-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Objc Mars Rover-Bridging-Header.h"; sourceTree = ""; }; + A52D26E0222DD6B700038CF5 /* PhotoDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoDetailViewController.swift; sourceTree = ""; }; + A52D26E1222DD6B700038CF5 /* PhotosCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotosCollectionViewController.swift; sourceTree = ""; }; + A52D26E4222DED6400038CF5 /* OSIViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = OSIViewController.swift; path = "Objc Mars Rover/View Controller/OSIViewController.swift"; sourceTree = SOURCE_ROOT; }; + A577FDDD2231C053000FC4A1 /* OSIMarsRoverPhoto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSIMarsRoverPhoto.h; sourceTree = ""; }; + A577FDDE2231C053000FC4A1 /* OSIMarsRoverPhoto.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSIMarsRoverPhoto.m; sourceTree = ""; }; + A577FDE02231CF60000FC4A1 /* URL+Secure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "URL+Secure.swift"; sourceTree = ""; }; + A5B556E2222F465900EFBAC7 /* ImageCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCollectionViewCell.swift; sourceTree = ""; }; + A5B556E4222F9BDB00EFBAC7 /* MarsPhoto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarsPhoto.swift; sourceTree = ""; }; + A5B556E5222F9BDB00EFBAC7 /* Camera.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Camera.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A52D26B1222DCC8C00038CF5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A52D26AB222DCC8C00038CF5 = { + isa = PBXGroup; + children = ( + A52D26B6222DCC8C00038CF5 /* Objc Mars Rover */, + A52D26B5222DCC8C00038CF5 /* Products */, + ); + sourceTree = ""; + }; + A52D26B5222DCC8C00038CF5 /* Products */ = { + isa = PBXGroup; + children = ( + A52D26B4222DCC8C00038CF5 /* Objc Mars Rover.app */, + ); + name = Products; + sourceTree = ""; + }; + A52D26B6222DCC8C00038CF5 /* Objc Mars Rover */ = { + isa = PBXGroup; + children = ( + A52D26B7222DCC8C00038CF5 /* AppDelegate.h */, + A52D26B8222DCC8C00038CF5 /* AppDelegate.m */, + A52D26D4222DD11400038CF5 /* Models */, + A52D26D9222DD2DF00038CF5 /* Model Controller */, + A52D26D0222DCF7E00038CF5 /* Networking */, + A52D26D5222DD12400038CF5 /* View Controller */, + A52D26DD222DD60000038CF5 /* Objc Mars Rover-Bridging-Header.h */, + A52D26BD222DCC8C00038CF5 /* Main.storyboard */, + A52D26C0222DCC8D00038CF5 /* Assets.xcassets */, + A52D26C2222DCC8D00038CF5 /* LaunchScreen.storyboard */, + A52D26C5222DCC8D00038CF5 /* Info.plist */, + A52D26C6222DCC8D00038CF5 /* main.m */, + ); + path = "Objc Mars Rover"; + sourceTree = ""; + }; + A52D26D0222DCF7E00038CF5 /* Networking */ = { + isa = PBXGroup; + children = ( + A52D26CD222DCF7000038CF5 /* OSIMarsRoverClient.h */, + A52D26CE222DCF7000038CF5 /* OSIMarsRoverClient.m */, + ); + path = Networking; + sourceTree = ""; + }; + A52D26D4222DD11400038CF5 /* Models */ = { + isa = PBXGroup; + children = ( + A5B556E4222F9BDB00EFBAC7 /* MarsPhoto.swift */, + A5B556E5222F9BDB00EFBAC7 /* Camera.swift */, + A52D26DA222DD34D00038CF5 /* OSIMarsRover.h */, + A52D26DB222DD34D00038CF5 /* OSIMarsRover.m */, + A577FDDD2231C053000FC4A1 /* OSIMarsRoverPhoto.h */, + A577FDDE2231C053000FC4A1 /* OSIMarsRoverPhoto.m */, + ); + path = Models; + sourceTree = ""; + }; + A52D26D5222DD12400038CF5 /* View Controller */ = { + isa = PBXGroup; + children = ( + A5B556E2222F465900EFBAC7 /* ImageCollectionViewCell.swift */, + A52D26E4222DED6400038CF5 /* OSIViewController.swift */, + A52D26E0222DD6B700038CF5 /* PhotoDetailViewController.swift */, + A52D26E1222DD6B700038CF5 /* PhotosCollectionViewController.swift */, + ); + path = "View Controller"; + sourceTree = ""; + }; + A52D26D9222DD2DF00038CF5 /* Model Controller */ = { + isa = PBXGroup; + children = ( + A52D26D6222DD2DB00038CF5 /* OSIModelController.h */, + A52D26D7222DD2DB00038CF5 /* OSIModelController.m */, + A577FDE02231CF60000FC4A1 /* URL+Secure.swift */, + ); + path = "Model Controller"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A52D26B3222DCC8C00038CF5 /* Objc Mars Rover */ = { + isa = PBXNativeTarget; + buildConfigurationList = A52D26CA222DCC8D00038CF5 /* Build configuration list for PBXNativeTarget "Objc Mars Rover" */; + buildPhases = ( + A52D26B0222DCC8C00038CF5 /* Sources */, + A52D26B1222DCC8C00038CF5 /* Frameworks */, + A52D26B2222DCC8C00038CF5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Objc Mars Rover"; + productName = "Objc Mars Rover"; + productReference = A52D26B4222DCC8C00038CF5 /* Objc Mars Rover.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A52D26AC222DCC8C00038CF5 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = OSI; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A52D26B3222DCC8C00038CF5 = { + CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1010; + }; + }; + }; + buildConfigurationList = A52D26AF222DCC8C00038CF5 /* Build configuration list for PBXProject "Objc Mars Rover" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A52D26AB222DCC8C00038CF5; + productRefGroup = A52D26B5222DCC8C00038CF5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A52D26B3222DCC8C00038CF5 /* Objc Mars Rover */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A52D26B2222DCC8C00038CF5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52D26C4222DCC8D00038CF5 /* LaunchScreen.storyboard in Resources */, + A52D26C1222DCC8D00038CF5 /* Assets.xcassets in Resources */, + A52D26BF222DCC8C00038CF5 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A52D26B0222DCC8C00038CF5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A5B556E7222F9BDB00EFBAC7 /* Camera.swift in Sources */, + A52D26D8222DD2DB00038CF5 /* OSIModelController.m in Sources */, + A52D26E3222DD6B700038CF5 /* PhotosCollectionViewController.swift in Sources */, + A52D26DC222DD34D00038CF5 /* OSIMarsRover.m in Sources */, + A577FDDF2231C053000FC4A1 /* OSIMarsRoverPhoto.m in Sources */, + A52D26C7222DCC8D00038CF5 /* main.m in Sources */, + A52D26E2222DD6B700038CF5 /* PhotoDetailViewController.swift in Sources */, + A52D26CF222DCF7000038CF5 /* OSIMarsRoverClient.m in Sources */, + A5B556E3222F465900EFBAC7 /* ImageCollectionViewCell.swift in Sources */, + A52D26E5222DED6400038CF5 /* OSIViewController.swift in Sources */, + A52D26B9222DCC8C00038CF5 /* AppDelegate.m in Sources */, + A5B556E6222F9BDB00EFBAC7 /* MarsPhoto.swift in Sources */, + A577FDE12231CF60000FC4A1 /* URL+Secure.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A52D26BD222DCC8C00038CF5 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A52D26BE222DCC8C00038CF5 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A52D26C2222DCC8D00038CF5 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A52D26C3222DCC8D00038CF5 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A52D26C8222DCC8D00038CF5 /* 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; + }; + A52D26C9222DCC8D00038CF5 /* 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; + }; + A52D26CB222DCC8D00038CF5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = "Objc Mars Rover/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "Sergey.Objc-Mars-Rover"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Objc Mars Rover/Objc Mars Rover-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A52D26CC222DCC8D00038CF5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = "Objc Mars Rover/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "Sergey.Objc-Mars-Rover"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Objc Mars Rover/Objc Mars Rover-Bridging-Header.h"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A52D26AF222DCC8C00038CF5 /* Build configuration list for PBXProject "Objc Mars Rover" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52D26C8222DCC8D00038CF5 /* Debug */, + A52D26C9222DCC8D00038CF5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A52D26CA222DCC8D00038CF5 /* Build configuration list for PBXNativeTarget "Objc Mars Rover" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52D26CB222DCC8D00038CF5 /* Debug */, + A52D26CC222DCC8D00038CF5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A52D26AC222DCC8C00038CF5 /* Project object */; +} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/AppDelegate.h b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/AppDelegate.h new file mode 100644 index 00000000..1c9445d1 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/AppDelegate.m b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/AppDelegate.m new file mode 100644 index 00000000..7c1dec30 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. 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/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/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/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/Contents.json b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/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/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/MarsPlaceholder.imageset/Contents.json b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/MarsPlaceholder.imageset/Contents.json new file mode 100644 index 00000000..22c1ae84 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/MarsPlaceholder.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "MarsPlaceholder.jpg", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder.jpg b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder.jpg new file mode 100644 index 00000000..a43b5801 Binary files /dev/null and b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Assets.xcassets/MarsPlaceholder.imageset/MarsPlaceholder.jpg differ diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Base.lproj/LaunchScreen.storyboard b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Base.lproj/Main.storyboard b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Base.lproj/Main.storyboard new file mode 100644 index 00000000..97f88c8d --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Base.lproj/Main.storyboard @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Info.plist b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Info.plist new file mode 100644 index 00000000..2feba9d5 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Info.plist @@ -0,0 +1,50 @@ + + + + + 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 + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/OSIModelController.h b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/OSIModelController.h new file mode 100644 index 00000000..7dc05f4a --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/OSIModelController.h @@ -0,0 +1,17 @@ +// +// OSIModelController.h +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIModelController : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/OSIModelController.m b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/OSIModelController.m new file mode 100644 index 00000000..ab2f82d6 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/OSIModelController.m @@ -0,0 +1,13 @@ +// +// OSIModelController.m +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIModelController.h" + +@implementation OSIModelController + +@end diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/URL+Secure.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/URL+Secure.swift new file mode 100644 index 00000000..02c0d5cd --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Model Controller/URL+Secure.swift @@ -0,0 +1,17 @@ +// +// URL+Secure.swift +// Astronomy +// +// Created by Andrew R Madsen on 9/5/18. +// Copyright © 2018 Lambda School. All rights reserved. +// + +import Foundation + +extension URL { + var usingHTTPS: URL? { + guard var components = URLComponents(url: self, resolvingAgainstBaseURL: true) else { return nil } + components.scheme = "https" + return components.url + } +} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/Camera.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/Camera.swift new file mode 100644 index 00000000..c77e29b1 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/Camera.swift @@ -0,0 +1,24 @@ +// +// Camera.swift +// Astronomy +// +// Created by Andrew R Madsen on 9/5/18. +// Copyright © 2018 Lambda School. All rights reserved. +// + +import Foundation + +class Camera: NSObject { + let id: Int + let name: String + let roverId: Int + let fullName: String + + @objc + init(id: Int, roverId: Int, name: String, fullName: String) { + self.id = id + self.roverId = roverId + self.name = name + self.fullName = fullName + } +} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/MarsPhoto.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/MarsPhoto.swift new file mode 100644 index 00000000..a7115f2f --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/MarsPhoto.swift @@ -0,0 +1,29 @@ +// +// MarsPhoto.swift +// Astronomy +// +// Created by Andrew R Madsen on 9/5/18. +// Copyright © 2018 Lambda School. All rights reserved. +// + +import Foundation + +class MarsPhotoReference: NSObject { + let id: Int + let sol: Int + //let camera: Camera + let earthDate: Date + + let imageURL: URL + + @objc + init(id: Int, sol: Int, earthDate: Date, imageURL: URL) { + self.id = id + self.sol = sol + // self.camera = camera + self.earthDate = earthDate + self.imageURL = imageURL + } + +} + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRover.h b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRover.h new file mode 100644 index 00000000..8c20787e --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRover.h @@ -0,0 +1,54 @@ +// +// OSISolDescription.h +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import +//#import "Objc_Mars_Rover-Swift.h" + + + +@class OSIMarsRover; +@class OSIPhoto1; +@class OSICamera; + +NS_ASSUME_NONNULL_BEGIN + +@interface OSICamera : NSObject +@property (nonatomic, readonly, copy) NSString *value; ++ (instancetype _Nullable)withValue:(NSString *)value; ++ (OSICamera *)chemcam; ++ (OSICamera *)fhaz; ++ (OSICamera *)mahli; ++ (OSICamera *)mardi; ++ (OSICamera *)mast; ++ (OSICamera *)navcam; ++ (OSICamera *)rhaz; +@end + + + +@interface OSIMarsRover : NSObject +@property (nonatomic, nullable, copy) NSString *name; +@property (nonatomic, nullable, copy) NSString *landingDate; +@property (nonatomic, nullable, copy) NSString *launchDate; +@property (nonatomic, nullable, copy) NSString *status; +@property (nonatomic, nullable, strong) NSNumber *maxSol; +@property (nonatomic, nullable, copy) NSString *maxDate; +@property (nonatomic, nullable, strong) NSNumber *totalPhotos; +@property (nonatomic, nullable, copy) NSArray *photos; +@end + + +@interface OSIPhoto1 : NSObject +@property (nonatomic, nullable, strong) NSNumber *sol; +@property (nonatomic, nullable, copy) NSString *earthDate; +@property (nonatomic, nullable, strong) NSNumber *totalPhotos; +@property (nonatomic, nullable, copy) NSArray *cameras; +@end + +NS_ASSUME_NONNULL_END + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRover.m b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRover.m new file mode 100644 index 00000000..bd7a3a92 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRover.m @@ -0,0 +1,20 @@ +// +// OSISolDescription.m +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIMarsRover.h" + +@implementation OSIMarsRover + +@end + + +@implementation OSIPhoto1 + + + +@end diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRoverPhoto.h b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRoverPhoto.h new file mode 100644 index 00000000..1b7a334b --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRoverPhoto.h @@ -0,0 +1,26 @@ +// +// OSIMarsRoverPhoto.h +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/7/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + + + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIMarsRoverPhoto : NSObject +@property NSInteger identifier; +@property NSInteger sol; + +@property NSDate *earthDate; +@property NSURL *imageURL; + +- (instancetype)initWithDictionary: (NSDictionary *)dictionary; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRoverPhoto.m b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRoverPhoto.m new file mode 100644 index 00000000..6b3661a5 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Models/OSIMarsRoverPhoto.m @@ -0,0 +1,30 @@ +// +// OSIMarsRoverPhoto.m +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/7/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIMarsRoverPhoto.h" + +@implementation OSIMarsRoverPhoto + +- (instancetype)initWithDictionary:(NSDictionary *)dictionary { + self = [self init]; + + NSNumber *identifier = dictionary[@"id"]; + self.identifier = identifier.integerValue; + + NSNumber *sol = dictionary[@"sol"]; + self.sol = sol.integerValue; + + + + NSString *imageURL = dictionary[@"img_src"]; + self.imageURL = [NSURL URLWithString:imageURL]; + + return self; +} + +@end diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Networking/OSIMarsRoverClient.h b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Networking/OSIMarsRoverClient.h new file mode 100644 index 00000000..b031d853 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Networking/OSIMarsRoverClient.h @@ -0,0 +1,28 @@ +// +// OSIMarsRoverClient.h +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import +#import "OSIMarsRover.h" +#import "OSIMarsRoverPhoto.h" + + +@class MarsPhotoReference; + + +NS_ASSUME_NONNULL_BEGIN + +@interface OSIMarsRoverClient : NSObject + +@property (nonatomic, readonly) NSArray *savedPhotos; + +- (instancetype)init; +- (void)fetchPhotosFrome:(OSIMarsRover *)rover onSol:(int )sol completion:(void (^)(NSArray *dict, NSError * _Nullable))completion; +- (void)searchForRover:(NSString *)roverName completion:(void (^)(OSIMarsRover *rover, NSError * _Nullable))completion; +@end + +NS_ASSUME_NONNULL_END diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Networking/OSIMarsRoverClient.m b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Networking/OSIMarsRoverClient.m new file mode 100644 index 00000000..c6e4a5b8 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Networking/OSIMarsRoverClient.m @@ -0,0 +1,161 @@ +// +// OSIMarsRoverClient.m +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import "OSIMarsRoverClient.h" +#import "OSIMarsRover.h" +#import "Objc_Mars_Rover-Swift.h" +#import "OSIMarsRoverPhoto.h" +// apiKey: A5GInzhik79kruLeQ4FYlN02lBcTmwnTnV5pHIKi +// baseURL = URL(string: "https://api.nasa.gov/mars-photos/api/v1")! + +@implementation OSIMarsRoverClient { + NSMutableArray *_savedPhotos; +} + +static NSString * const baseURL = @"https://api.nasa.gov/mars-photos/api/v1"; +static NSString * const apiKey = @"A5GInzhik79kruLeQ4FYlN02lBcTmwnTnV5pHIKi"; + +- (instancetype)init { + self = [super init]; + if (self != nil) { + _savedPhotos = [NSMutableArray array]; + } + return self; +} + +- (NSArray *)savedPhotos { + return [_savedPhotos copy]; +} + + + +- (void)searchForRover:(NSString *)roverName completion:(void (^)(OSIMarsRover *rover, NSError * _Nullable))completion { + + + NSURL *url = [NSURL URLWithString:baseURL]; + + url = [url URLByAppendingPathComponent:@"manifests"]; + url = [url URLByAppendingPathComponent:roverName]; + + + NSURLComponents * urlComponents = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:YES];; + + NSURLQueryItem *queryItemApiKey = [NSURLQueryItem queryItemWithName:@"api_key" value:apiKey]; + [urlComponents setQueryItems:@[queryItemApiKey]]; + + NSURL *requestURL = [urlComponents URL]; + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL]; + + [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler: + ^(NSData * _Nullable data, + NSURLResponse * _Nullable response, + NSError * _Nullable error) { + + if (error) { + NSLog(@"Error fetching data: %@", error); + completion(nil, error); + return; + } + if (!data) { + NSLog(@"Data is missing"); + completion(nil, [[NSError alloc] init]); + return; + } + + NSDictionary *marsRoverJSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL]; + if (![marsRoverJSON isKindOfClass:[NSDictionary class]]) { + NSLog(@"JSON error, not dictinary"); + completion(nil, error); + + return; + } + NSArray *results = [marsRoverJSON objectForKey:@"photo_manifest"]; + + OSIMarsRover *marsRover = [[OSIMarsRover alloc] init]; + + marsRover.name = [results valueForKey:@"name"]; + marsRover.status = [results valueForKey:@"status"]; + marsRover.launchDate = [results valueForKey:@"launch_date"]; + marsRover.landingDate = [results valueForKey:@"landing_date"]; + marsRover.maxSol = [results valueForKey:@"max-sol"]; + marsRover.maxDate = [results valueForKey:@"max-date"]; + // marsRover.photos = [results valueForKey:@"photos"]; + marsRover.totalPhotos = [results valueForKey:@"total_photos"]; + + NSArray *photoDict = [results valueForKey:@"photos"]; + + NSMutableArray *photos = [NSMutableArray array]; + + for (NSDictionary *phot in photoDict) { + OSIPhoto1 *photo = [[OSIPhoto1 alloc] init]; + + photo.sol = [phot valueForKey:@"sol"]; + photo.totalPhotos = [phot valueForKey:@"total_photos"]; + photo.earthDate = [phot valueForKey:@"earth_date"]; + photo.cameras = [phot valueForKey:@"cameras"]; + + [photos addObject:photo]; + } + marsRover.photos = photos; + + completion(marsRover, nil); + + }]resume]; +} + + +- (void)fetchPhotosFrome:(OSIMarsRover *)rover onSol:(int )sol completion:(void (^)(NSArray *dict, NSError * _Nullable))completion { + + NSURL *url = [NSURL URLWithString:baseURL]; + + url = [url URLByAppendingPathComponent:@"rovers"]; + url = [url URLByAppendingPathComponent:rover.name]; + url = [url URLByAppendingPathComponent:@"photos"]; + + NSURLComponents * urlComponents = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:YES]; + NSNumber *solNumber = [NSNumber numberWithInt:sol]; + NSString *solString = [NSNumberFormatter localizedStringFromNumber:solNumber numberStyle:NSNumberFormatterDecimalStyle]; + NSURLQueryItem *queryItemSol = [NSURLQueryItem queryItemWithName:@"sol" value:solString]; + NSURLQueryItem *queryItemApiKey = [NSURLQueryItem queryItemWithName:@"api_key" value:apiKey]; + [urlComponents setQueryItems:@[queryItemApiKey, queryItemSol]]; + + NSURL *requestURL = [urlComponents URL]; + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL]; + + [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler: + ^(NSData * _Nullable data, + NSURLResponse * _Nullable response, + NSError * _Nullable error) { + + if (error) { + NSLog(@"Error fetching data: %@", error); + completion(nil, error); + return; + } + if (!data) { + NSLog(@"Data is missing"); + completion(nil, [[NSError alloc] init]); + return; + } + NSDictionary *photoJSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL]; + + NSArray *photos = photoJSON[@"photos"]; + NSMutableArray *references = [[NSMutableArray alloc] init]; + + for (NSDictionary *photo in photos) { + OSIMarsRoverPhoto *reference = [[OSIMarsRoverPhoto alloc] initWithDictionary: photo]; + [references addObject: reference]; + } + + completion([references copy], nil); + + }]resume]; + } + + @end + diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Objc Mars Rover-Bridging-Header.h b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Objc Mars Rover-Bridging-Header.h new file mode 100644 index 00000000..ccd62ef8 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/Objc Mars Rover-Bridging-Header.h @@ -0,0 +1,7 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#import "OSIMarsRoverClient.h" +#import "OSIMarsRover.h" +#import "OSIMarsRoverPhoto.h" diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/ImageCollectionViewCell.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/ImageCollectionViewCell.swift new file mode 100644 index 00000000..6e593101 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/ImageCollectionViewCell.swift @@ -0,0 +1,24 @@ +// +// ImageCollectionViewCell.swift +// Astronomy +// +// Created by Andrew R Madsen on 9/5/18. +// Copyright © 2018 Lambda School. All rights reserved. +// + +import UIKit + +class ImageCollectionViewCell: UICollectionViewCell { + + override func prepareForReuse() { + super.prepareForReuse() + imageView.image = UIImage(named: "MarsPlaceholder") + } + + // MARK: Properties + + // MARK: IBOutlets + + @IBOutlet weak var photoLabel: UILabel! + @IBOutlet var imageView: UIImageView! +} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/OSIViewController.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/OSIViewController.swift new file mode 100644 index 00000000..31c5c25a --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/OSIViewController.swift @@ -0,0 +1,39 @@ +// +// OSIViewController.swift +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class OSIViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + + let oSIMarsRoverClient = OSIMarsRoverClient() + + + oSIMarsRoverClient.search(forRover: "curiosity") { rover, error in + + + } + + // oSIMarsRoverClient.search(forPhotos: "curiosity", sol: 1) + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/PhotoDetailViewController.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/PhotoDetailViewController.swift new file mode 100644 index 00000000..62081c36 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/PhotoDetailViewController.swift @@ -0,0 +1,77 @@ +//// +//// PhotoDetailViewController.swift +//// Astronomy +//// +//// Created by Andrew R Madsen on 9/9/18. +//// Copyright © 2018 Lambda School. All rights reserved. +//// +// +//import UIKit +//import Photos +// +//class PhotoDetailViewController: UIViewController { +// +// override func viewDidLoad() { +// super.viewDidLoad() +// updateViews() +// } +// +// @IBAction func save(_ sender: Any) { +// guard let image = imageView.image else { return } +// PHPhotoLibrary.shared().performChanges({ +// PHAssetChangeRequest.creationRequestForAsset(from: image) +// }, completionHandler: { (success, error) in +// if let error = error { +// NSLog("Error saving photo: \(error)") +// return +// } +// DispatchQueue.main.async { +// self.presentSuccessfulSaveAlert() +// } +// }) +// } +// +// func presentSuccessfulSaveAlert() { +// let alert = UIAlertController(title: "Photo Saved!", message: "The photo has been saved to your Photo Library!", preferredStyle: .alert) +// let okayAction = UIAlertAction(title: "Okay", style: .default, handler: nil) +// +// alert.addAction(okayAction) +// +// present(alert, animated: true, completion: nil) +// } +// +// // MARK: - Private +// +// private func updateViews() { +// guard let photo = photo, isViewLoaded else { return } +// do { +// let data = try Data(contentsOf: photo.imageURL.usingHTTPS!) +// imageView.image = UIImage(data: data) +// let dateString = dateFormatter.string(from: photo.earthDate) +// detailLabel.text = "Taken by \(photo.camera.roverId) on \(dateString) (Sol \(photo.sol))" +// cameraLabel.text = photo.camera.fullName +// } catch { +// NSLog("Error setting up views on detail view controller: \(error)") +// } +// } +// +// // MARK: - Properties +// +// var photo: MarsPhotoReference? { +// didSet { +// updateViews() +// } +// } +// +// lazy var dateFormatter: DateFormatter = { +// let df = DateFormatter() +// df.dateStyle = .short +// df.timeStyle = .short +// return df +// }() +// +// @IBOutlet weak var imageView: UIImageView! +// @IBOutlet weak var detailLabel: UILabel! +// @IBOutlet weak var cameraLabel: UILabel! +// +//} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/PhotosCollectionViewController.swift b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/PhotosCollectionViewController.swift new file mode 100644 index 00000000..339ec9ac --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/View Controller/PhotosCollectionViewController.swift @@ -0,0 +1,245 @@ +// +// PhotosCollectionViewController.swift +// Astronomy +// +// Created by Andrew R Madsen on 9/5/18. +// Copyright © 2018 Lambda School. All rights reserved. +// + +import UIKit + +class PhotosCollectionViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + + @IBOutlet var collection: UICollectionView! + let osiMarsRoverClient = OSIMarsRoverClient() + + override func viewDidLoad() { + super.viewDidLoad() + osiMarsRoverClient.search(forRover: "curiosity") { rover, error in + if let error = error { + NSLog("Error fetching info for curiosity: \(error)") + return + } + self.roverInfo = rover + DispatchQueue.main.async { + self.collection.reloadData() + } + + } + + + + configureTitleView() + updateViews() + } + + @IBAction func goToPreviousSol(_ sender: Any?) { + guard let solDescription = solDescription else { return } + guard let solDescriptions = roverInfo?.photos else { return } + guard let index = solDescriptions.index(of: solDescription) else { return } + guard index > 0 else { return } + self.solDescription = solDescriptions[index-1] + + } + + @IBAction func goToNextSol(_ sender: Any?) { + guard let solDescription = solDescription else { return } + guard let solDescriptions = roverInfo?.photos else { return } + guard let index = solDescriptions.index(of: solDescription) else { return } + guard index < solDescriptions.count - 1 else { return } + self.solDescription = solDescriptions[index+1] + + } + + // UICollectionViewDataSource/Delegate + + func numberOfSections(in collectionView: UICollectionView) -> Int { + return 1 + } + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + NSLog("num photos: \(photoReferences.count)") + return photoReferences.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ImageCell", for: indexPath) as? ImageCollectionViewCell else { return ImageCollectionViewCell() } + let photoRef = photoReferences[indexPath.row] + + let imageData = try? Data(contentsOf: photoRef.imageURL) + cell.imageView.image = UIImage(data: imageData!) + cell.photoLabel.text = roverInfo?.name + // loadImage(forCell: cell, forItemAt: indexPath) + + return cell + } + + func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + if photoReferences.count > 0 { + // let photoRef = photoReferences[indexPath.item] + // operations[photoRef.id]?.cancel() + } else { + for (_, operation) in operations { + operation.cancel() + } + } + } + +// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { +// let flowLayout = collectionViewLayout as! UICollectionViewFlowLayout +// var totalUsableWidth = collectionView.frame.width +// let inset = self.collectionView(collectionView, layout: collectionViewLayout, insetForSectionAt: indexPath.section) +// totalUsableWidth -= inset.left + inset.right +// +// let minWidth: CGFloat = 150.0 +// let numberOfItemsInOneRow = Int(totalUsableWidth / minWidth) +// totalUsableWidth -= CGFloat(numberOfItemsInOneRow - 1) * flowLayout.minimumInteritemSpacing +// let width = totalUsableWidth / CGFloat(numberOfItemsInOneRow) +// return CGSize(width: width, height: width) +// } + +// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { +// return UIEdgeInsets(top: 0, left: 10.0, bottom: 0, right: 10.0) +// } + + // MARK: - Navigation + +// override func prepare(for segue: UIStoryboardSegue, sender: Any?) { +// if segue.identifier == "ShowDetail" { +// guard let indexPath = collectionView.indexPathsForSelectedItems?.first else { return } +// let detailVC = segue.destination as! PhotoDetailViewController +// detailVC.photo = photoReferences[indexPath.item] +// } +// } + + // MARK: - Private + + private func configureTitleView() { + + let font = UIFont.systemFont(ofSize: 30) + let attrs = [NSAttributedString.Key.font: font] + + let prevTitle = NSAttributedString(string: "<", attributes: attrs) + let prevButton = UIButton(type: .system) + prevButton.accessibilityIdentifier = "PhotosCollectionViewController.PreviousSolButton" + prevButton.setAttributedTitle(prevTitle, for: .normal) + prevButton.addTarget(self, action: #selector(goToPreviousSol(_:)), for: .touchUpInside) + + let nextTitle = NSAttributedString(string: ">", attributes: attrs) + let nextButton = UIButton(type: .system) + nextButton.setAttributedTitle(nextTitle, for: .normal) + nextButton.addTarget(self, action: #selector(goToNextSol(_:)), for: .touchUpInside) + nextButton.accessibilityIdentifier = "PhotosCollectionViewController.NextSolButton" + + let stackView = UIStackView(arrangedSubviews: [prevButton, solLabel, nextButton]) + stackView.axis = .horizontal + stackView.alignment = .fill + stackView.distribution = .fill + stackView.spacing = UIStackView.spacingUseSystem + + navigationItem.titleView = stackView + } + + @IBAction func refresh(_ sender: Any) { + DispatchQueue.main.async { + self.collection.reloadData() + } + + } + private func updateViews() { + guard isViewLoaded else { return } + solLabel.text = "Sol \(solDescription?.sol ?? 0)" + + } + +// private func loadImage(forCell cell: ImageCollectionViewCell, forItemAt indexPath: IndexPath) { +// let photoReference = photoReferences[indexPath.item] +// // Check for image in cache +// if let cachedImage = cache.value(for: photoReference.id) { +// cell.imageView.image = cachedImage +// return +// } +// +// // Start an operation to fetch image data +// // let fetchOp = FetchPhotoOperation(photoReference: photoReference) +// let cacheOp = BlockOperation { +// if let image = fetchOp.image { +// self.cache.cache(value: image, for: photoReference.id) +// } +// } +// let completionOp = BlockOperation { +// defer { self.operations.removeValue(forKey: photoReference.id) } +// +// if let currentIndexPath = self.collectionView?.indexPath(for: cell), +// currentIndexPath != indexPath { +// return // Cell has been reused +// } +// +// if let image = fetchOp.image { +// cell.imageView.image = image +// } +// } +// +// cacheOp.addDependency(fetchOp) +// completionOp.addDependency(fetchOp) +// +// photoFetchQueue.addOperation(fetchOp) +// photoFetchQueue.addOperation(cacheOp) +// OperationQueue.main.addOperation(completionOp) +// +// operations[photoReference.id] = fetchOp +// } + + // Properties + + + // private let cache = Cache() + private let photoFetchQueue = OperationQueue() + private var operations = [Int : Operation]() + + private var roverInfo: OSIMarsRover? { + didSet { + solDescription = roverInfo?.photos?[0] + } + } + + private var photo: MarsPhotoReference? { + didSet { + + } + } + + private var solDescription: OSIPhoto1? { + didSet { + if let rover = roverInfo, + let sol = solDescription?.sol { + // photoReferences = [] + osiMarsRoverClient.fetchPhotosFrome(rover, onSol: Int32(truncating: sol)) {photoRef, error in + + if let error = error { + NSLog("Error fetching info for curiosity: \(error)") + return + } + self.photoReferences = photoRef + + } + + DispatchQueue.main.async { self.updateViews() } + + } + + + } + } + + + private var photoReferences = [OSIMarsRoverPhoto]() { + didSet { + // cache.clear() + DispatchQueue.main.async { self.collectionView?.reloadData() } + } + } + + @IBOutlet var collectionView: UICollectionView! + let solLabel = UILabel() +} diff --git a/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/main.m b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/main.m new file mode 100644 index 00000000..f7938e10 --- /dev/null +++ b/Sprint 12/Modules 2&3/Objc Mars Rover/Objc Mars Rover/main.m @@ -0,0 +1,21 @@ +// +// main.m +// Objc Mars Rover +// +// Created by Sergey Osipyan on 3/4/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import +#import "AppDelegate.h" +#import "OSIMarsRoverClient.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + + + + + } +} diff --git a/Sprint 6/Module 2-Custom Controls/UIControl/UIControl.xcodeproj/project.pbxproj b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl.xcodeproj/project.pbxproj new file mode 100644 index 00000000..6ae20007 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl.xcodeproj/project.pbxproj @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A57C44AE21E53AE80080E970 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57C44AD21E53AE80080E970 /* AppDelegate.swift */; }; + A57C44B021E53AE80080E970 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57C44AF21E53AE80080E970 /* ViewController.swift */; }; + A57C44B321E53AE80080E970 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A57C44B121E53AE80080E970 /* Main.storyboard */; }; + A57C44B521E53AE90080E970 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A57C44B421E53AE90080E970 /* Assets.xcassets */; }; + A57C44B821E53AE90080E970 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A57C44B621E53AE90080E970 /* LaunchScreen.storyboard */; }; + A57C44C021E53BC20080E970 /* CustomControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57C44BF21E53BC20080E970 /* CustomControl.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A57C44AA21E53AE80080E970 /* UIControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A57C44AD21E53AE80080E970 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A57C44AF21E53AE80080E970 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A57C44B221E53AE80080E970 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A57C44B421E53AE90080E970 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A57C44B721E53AE90080E970 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A57C44B921E53AE90080E970 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A57C44BF21E53BC20080E970 /* CustomControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomControl.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A57C44A721E53AE80080E970 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A57C44A121E53AE80080E970 = { + isa = PBXGroup; + children = ( + A57C44AC21E53AE80080E970 /* UIControl */, + A57C44AB21E53AE80080E970 /* Products */, + ); + sourceTree = ""; + }; + A57C44AB21E53AE80080E970 /* Products */ = { + isa = PBXGroup; + children = ( + A57C44AA21E53AE80080E970 /* UIControl.app */, + ); + name = Products; + sourceTree = ""; + }; + A57C44AC21E53AE80080E970 /* UIControl */ = { + isa = PBXGroup; + children = ( + A57C44AD21E53AE80080E970 /* AppDelegate.swift */, + A57C44AF21E53AE80080E970 /* ViewController.swift */, + A57C44B121E53AE80080E970 /* Main.storyboard */, + A57C44BF21E53BC20080E970 /* CustomControl.swift */, + A57C44B421E53AE90080E970 /* Assets.xcassets */, + A57C44B621E53AE90080E970 /* LaunchScreen.storyboard */, + A57C44B921E53AE90080E970 /* Info.plist */, + ); + path = UIControl; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A57C44A921E53AE80080E970 /* UIControl */ = { + isa = PBXNativeTarget; + buildConfigurationList = A57C44BC21E53AE90080E970 /* Build configuration list for PBXNativeTarget "UIControl" */; + buildPhases = ( + A57C44A621E53AE80080E970 /* Sources */, + A57C44A721E53AE80080E970 /* Frameworks */, + A57C44A821E53AE80080E970 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = UIControl; + productName = UIControl; + productReference = A57C44AA21E53AE80080E970 /* UIControl.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A57C44A221E53AE80080E970 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A57C44A921E53AE80080E970 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A57C44A521E53AE80080E970 /* Build configuration list for PBXProject "UIControl" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A57C44A121E53AE80080E970; + productRefGroup = A57C44AB21E53AE80080E970 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A57C44A921E53AE80080E970 /* UIControl */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A57C44A821E53AE80080E970 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A57C44B821E53AE90080E970 /* LaunchScreen.storyboard in Resources */, + A57C44B521E53AE90080E970 /* Assets.xcassets in Resources */, + A57C44B321E53AE80080E970 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A57C44A621E53AE80080E970 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A57C44B021E53AE80080E970 /* ViewController.swift in Sources */, + A57C44C021E53BC20080E970 /* CustomControl.swift in Sources */, + A57C44AE21E53AE80080E970 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A57C44B121E53AE80080E970 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A57C44B221E53AE80080E970 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A57C44B621E53AE90080E970 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A57C44B721E53AE90080E970 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A57C44BA21E53AE90080E970 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A57C44BB21E53AE90080E970 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A57C44BD21E53AE90080E970 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = UIControl/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.UIControl; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A57C44BE21E53AE90080E970 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = UIControl/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.UIControl; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A57C44A521E53AE80080E970 /* Build configuration list for PBXProject "UIControl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A57C44BA21E53AE90080E970 /* Debug */, + A57C44BB21E53AE90080E970 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A57C44BC21E53AE90080E970 /* Build configuration list for PBXNativeTarget "UIControl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A57C44BD21E53AE90080E970 /* Debug */, + A57C44BE21E53AE90080E970 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A57C44A221E53AE80080E970 /* Project object */; +} diff --git a/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/AppDelegate.swift b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/AppDelegate.swift new file mode 100644 index 00000000..699afe75 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// UIControl +// +// Created by Sergey Osipyan on 1/8/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/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/UIControl/UIControl/Assets.xcassets/Contents.json b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/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/UIControl/UIControl/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Base.lproj/Main.storyboard b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Base.lproj/Main.storyboard new file mode 100644 index 00000000..8b39ee51 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Base.lproj/Main.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/CustomControl.swift b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/CustomControl.swift new file mode 100644 index 00000000..b6f9068f --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/CustomControl.swift @@ -0,0 +1,124 @@ +// +// CustomControl.swift +// UIControl +// +// Created by Sergey Osipyan on 1/8/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class CustomControl: UIControl { + + + static var value: Int = 1 + + private let componentDimension: CGFloat = 40.0 + private let componentCount = 5 + private let componentActiveColor = UIColor.black + private let componentInactiveColor = UIColor.gray + + required init?(coder aCoder: NSCoder) { + super.init(coder: aCoder) + setup() + + } + + var labels: [UILabel] = [] + + func setup() { + + var tags: [Int] = [] + var coordinate: CGFloat = 8.0 + for number in 1...6 { + + var label = UILabel() + + + let location: CGFloat = coordinate + label = UILabel(frame: CGRect(x: location, y: 0.0, width: componentDimension, height: componentDimension)) + label.tag = number + label.font = UIFont.boldSystemFont(ofSize: 32.0) + label.text = "✯" + label.textAlignment = .center + label.textColor = componentInactiveColor + self.addSubview(label) + labels.append(label) + tags.append(tag) + coordinate += 48 + + + } + } + + + + override var intrinsicContentSize: CGSize { + let componentsWidth = CGFloat(componentCount) * componentDimension + let componentsSpacing = CGFloat(componentCount + 7) * 8.0 + let width = componentsWidth + componentsSpacing + return CGSize(width: width, height: componentDimension) + } + + override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + updateValue(at: touch) + sendActions(for: [.touchDown, .valueChanged]) + return true + } + + override func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + let touchPoint = touch.location(in: self) + if bounds.contains(touchPoint){ + self.updateValue(at: touch) + sendActions(for: [.touchDragInside, .valueChanged]) + } else { + sendActions(for: [.touchDragOutside]) + } + return true + } + + override func endTracking(_ touch: UITouch?, with event: UIEvent?) { + guard let touchPoint = touch?.location(in: self) else {return} + if bounds.contains(touchPoint){ + self.updateValue(at: touch!) + sendActions(for: [.touchUpInside, .valueChanged]) + } else { + sendActions(for: [.touchUpOutside]) + } + } + + override func cancelTracking(with event: UIEvent?) { + sendActions(for: .touchCancel) + super.cancelTracking(with: event) + } + + func updateValue(at touch: UITouch ) { + for label in labels { + let touchPoint = touch.location(in: label) + if bounds.contains(touchPoint) { CustomControl.value = label.tag } + if CustomControl.value >= label.tag { + label.textColor = componentActiveColor + label.performFlare() + + } else { + label.textColor = componentInactiveColor + } + sendActions(for: [.valueChanged]) + } + } + +} + extension UIView { + // "Flare view" animation sequence + func performFlare() { + func flare() { transform = CGAffineTransform(scaleX: 2.0, y: 2.0) + transform = CGAffineTransform(rotationAngle: 15.0) } + func unflare() { transform = .identity } + + UIView.animate(withDuration: 0.3, + animations: { flare() }, + completion: { _ in UIView.animate(withDuration: 0.1) { unflare() }}) + } + } + + diff --git a/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Info.plist b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/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/UIControl/UIControl/ViewController.swift b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/ViewController.swift new file mode 100644 index 00000000..c23ead62 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControl/UIControl/ViewController.swift @@ -0,0 +1,32 @@ +// +// ViewController.swift +// UIControl +// +// Created by Sergey Osipyan on 1/8/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + + } + + @IBAction func updateRating(_ ratingControl: CustomControl) { + + if CustomControl.value < 2 { + self.navigationItem.title = "User Rating: \(CustomControl.value) star" + } else { + + self.navigationItem.title = "User Rating: \(CustomControl.value) stars" + + } + + +} + +} diff --git a/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl.xcodeproj/project.pbxproj b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl.xcodeproj/project.pbxproj new file mode 100644 index 00000000..6ae20007 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl.xcodeproj/project.pbxproj @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A57C44AE21E53AE80080E970 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57C44AD21E53AE80080E970 /* AppDelegate.swift */; }; + A57C44B021E53AE80080E970 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57C44AF21E53AE80080E970 /* ViewController.swift */; }; + A57C44B321E53AE80080E970 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A57C44B121E53AE80080E970 /* Main.storyboard */; }; + A57C44B521E53AE90080E970 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A57C44B421E53AE90080E970 /* Assets.xcassets */; }; + A57C44B821E53AE90080E970 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A57C44B621E53AE90080E970 /* LaunchScreen.storyboard */; }; + A57C44C021E53BC20080E970 /* CustomControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57C44BF21E53BC20080E970 /* CustomControl.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A57C44AA21E53AE80080E970 /* UIControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A57C44AD21E53AE80080E970 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A57C44AF21E53AE80080E970 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A57C44B221E53AE80080E970 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A57C44B421E53AE90080E970 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A57C44B721E53AE90080E970 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A57C44B921E53AE90080E970 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A57C44BF21E53BC20080E970 /* CustomControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomControl.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A57C44A721E53AE80080E970 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A57C44A121E53AE80080E970 = { + isa = PBXGroup; + children = ( + A57C44AC21E53AE80080E970 /* UIControl */, + A57C44AB21E53AE80080E970 /* Products */, + ); + sourceTree = ""; + }; + A57C44AB21E53AE80080E970 /* Products */ = { + isa = PBXGroup; + children = ( + A57C44AA21E53AE80080E970 /* UIControl.app */, + ); + name = Products; + sourceTree = ""; + }; + A57C44AC21E53AE80080E970 /* UIControl */ = { + isa = PBXGroup; + children = ( + A57C44AD21E53AE80080E970 /* AppDelegate.swift */, + A57C44AF21E53AE80080E970 /* ViewController.swift */, + A57C44B121E53AE80080E970 /* Main.storyboard */, + A57C44BF21E53BC20080E970 /* CustomControl.swift */, + A57C44B421E53AE90080E970 /* Assets.xcassets */, + A57C44B621E53AE90080E970 /* LaunchScreen.storyboard */, + A57C44B921E53AE90080E970 /* Info.plist */, + ); + path = UIControl; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A57C44A921E53AE80080E970 /* UIControl */ = { + isa = PBXNativeTarget; + buildConfigurationList = A57C44BC21E53AE90080E970 /* Build configuration list for PBXNativeTarget "UIControl" */; + buildPhases = ( + A57C44A621E53AE80080E970 /* Sources */, + A57C44A721E53AE80080E970 /* Frameworks */, + A57C44A821E53AE80080E970 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = UIControl; + productName = UIControl; + productReference = A57C44AA21E53AE80080E970 /* UIControl.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A57C44A221E53AE80080E970 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A57C44A921E53AE80080E970 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A57C44A521E53AE80080E970 /* Build configuration list for PBXProject "UIControl" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A57C44A121E53AE80080E970; + productRefGroup = A57C44AB21E53AE80080E970 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A57C44A921E53AE80080E970 /* UIControl */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A57C44A821E53AE80080E970 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A57C44B821E53AE90080E970 /* LaunchScreen.storyboard in Resources */, + A57C44B521E53AE90080E970 /* Assets.xcassets in Resources */, + A57C44B321E53AE80080E970 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A57C44A621E53AE80080E970 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A57C44B021E53AE80080E970 /* ViewController.swift in Sources */, + A57C44C021E53BC20080E970 /* CustomControl.swift in Sources */, + A57C44AE21E53AE80080E970 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A57C44B121E53AE80080E970 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A57C44B221E53AE80080E970 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A57C44B621E53AE90080E970 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A57C44B721E53AE90080E970 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A57C44BA21E53AE90080E970 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A57C44BB21E53AE90080E970 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A57C44BD21E53AE90080E970 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = UIControl/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.UIControl; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A57C44BE21E53AE90080E970 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = UIControl/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.UIControl; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A57C44A521E53AE80080E970 /* Build configuration list for PBXProject "UIControl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A57C44BA21E53AE90080E970 /* Debug */, + A57C44BB21E53AE90080E970 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A57C44BC21E53AE90080E970 /* Build configuration list for PBXNativeTarget "UIControl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A57C44BD21E53AE90080E970 /* Debug */, + A57C44BE21E53AE90080E970 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A57C44A221E53AE80080E970 /* Project object */; +} diff --git a/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/AppDelegate.swift b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/AppDelegate.swift new file mode 100644 index 00000000..699afe75 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// UIControl +// +// Created by Sergey Osipyan on 1/8/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/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/UIControlAsync/UIControl/Assets.xcassets/Contents.json b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/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/UIControlAsync/UIControl/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Base.lproj/Main.storyboard b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Base.lproj/Main.storyboard new file mode 100644 index 00000000..475b00b1 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Base.lproj/Main.storyboard @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/CustomControl.swift b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/CustomControl.swift new file mode 100644 index 00000000..51661568 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/CustomControl.swift @@ -0,0 +1,123 @@ +// +// CustomControl.swift +// UIControl +// +// Created by Sergey Osipyan on 1/8/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class CustomControl: UIControl { + + + static var value: Int = 1 + + private let componentDimension: CGFloat = 40.0 + private let componentCount = 5 + private let componentActiveColor = UIColor.black + private let componentInactiveColor = UIColor.gray + + required init?(coder aCoder: NSCoder) { + super.init(coder: aCoder) + setup() + + } + + var labels: [UILabel] = [] + + func setup() { + + var tags: [Int] = [] + var coordinate: CGFloat = 8.0 + for number in 1...6 { + + var label = UILabel() + + + let location: CGFloat = coordinate + label = UILabel(frame: CGRect(x: location, y: 0.0, width: componentDimension, height: componentDimension)) + label.tag = number + label.font = UIFont.boldSystemFont(ofSize: 32.0) + label.text = "✯" + label.textAlignment = .center + label.textColor = componentInactiveColor + self.addSubview(label) + labels.append(label) + tags.append(tag) + coordinate += 48 + + + } + } + + + + override var intrinsicContentSize: CGSize { + let componentsWidth = CGFloat(componentCount) * componentDimension + let componentsSpacing = CGFloat(componentCount + 7) * 8.0 + let width = componentsWidth + componentsSpacing + return CGSize(width: width, height: componentDimension) + } + + override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + updateValue(at: touch) + sendActions(for: [.touchDown, .valueChanged]) + return true + } + + override func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { + let touchPoint = touch.location(in: self) + if bounds.contains(touchPoint){ + updateValue(at: touch) + sendActions(for: [.touchDragInside, .valueChanged]) + } 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){ + updateValue(at: touch) + sendActions(for: [.touchUpInside, .valueChanged]) + } else { + sendActions(for: [.touchUpOutside]) + } + } + + override func cancelTracking(with event: UIEvent?) { + sendActions(for: .touchCancel) + super.cancelTracking(with: event) + } + + func updateValue(at touch: UITouch ) { + for label in labels { + let touchPoint = touch.location(in: label) + if bounds.contains(touchPoint) { CustomControl.value = label.tag } + if CustomControl.value >= label.tag { + label.textColor = componentActiveColor + label.performFlare() + + } else { + label.textColor = componentInactiveColor + } + sendActions(for: [.valueChanged]) + } + } + +} +extension UIView { + // "Flare view" animation sequence + func performFlare() { + func flare() { transform = CGAffineTransform(scaleX: 2.0, y: 2.0) + transform = CGAffineTransform(rotationAngle: 15.0) } + func unflare() { transform = .identity } + + UIView.animate(withDuration: 0.3, + animations: { flare() }, + completion: { _ in UIView.animate(withDuration: 0.1) { unflare() }}) + } +} diff --git a/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Info.plist b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/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/UIControlAsync/UIControl/ViewController.swift b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/ViewController.swift new file mode 100644 index 00000000..805dfa8d --- /dev/null +++ b/Sprint 6/Module 2-Custom Controls/UIControlAsync/UIControl/ViewController.swift @@ -0,0 +1,32 @@ +// +// ViewController.swift +// UIControl +// +// Created by Sergey Osipyan on 1/8/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .yellow + + } + + @IBAction func updateRating(_ ratingControl: CustomControl) { + + if CustomControl.value < 2 { + self.navigationItem.title = "User Rating: \(CustomControl.value) star" + } else { + + self.navigationItem.title = "User Rating: \(CustomControl.value) stars" + + } + + +} + +} diff --git a/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints.xcodeproj/project.pbxproj b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints.xcodeproj/project.pbxproj new file mode 100644 index 00000000..91bc6d13 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A513CCAC21EF9CD000857436 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A513CCAB21EF9CD000857436 /* AppDelegate.swift */; }; + A513CCAE21EF9CD000857436 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A513CCAD21EF9CD000857436 /* ViewController.swift */; }; + A513CCB121EF9CD000857436 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A513CCAF21EF9CD000857436 /* Main.storyboard */; }; + A513CCB321EF9CD400857436 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A513CCB221EF9CD400857436 /* Assets.xcassets */; }; + A513CCB621EF9CD400857436 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A513CCB421EF9CD400857436 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A513CCA821EF9CD000857436 /* Constraints.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Constraints.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A513CCAB21EF9CD000857436 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A513CCAD21EF9CD000857436 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A513CCB021EF9CD000857436 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A513CCB221EF9CD400857436 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A513CCB521EF9CD400857436 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A513CCB721EF9CD400857436 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A513CCA521EF9CD000857436 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A513CC9F21EF9CD000857436 = { + isa = PBXGroup; + children = ( + A513CCAA21EF9CD000857436 /* Constraints */, + A513CCA921EF9CD000857436 /* Products */, + ); + sourceTree = ""; + }; + A513CCA921EF9CD000857436 /* Products */ = { + isa = PBXGroup; + children = ( + A513CCA821EF9CD000857436 /* Constraints.app */, + ); + name = Products; + sourceTree = ""; + }; + A513CCAA21EF9CD000857436 /* Constraints */ = { + isa = PBXGroup; + children = ( + A513CCAB21EF9CD000857436 /* AppDelegate.swift */, + A513CCAD21EF9CD000857436 /* ViewController.swift */, + A513CCAF21EF9CD000857436 /* Main.storyboard */, + A513CCB221EF9CD400857436 /* Assets.xcassets */, + A513CCB421EF9CD400857436 /* LaunchScreen.storyboard */, + A513CCB721EF9CD400857436 /* Info.plist */, + ); + path = Constraints; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A513CCA721EF9CD000857436 /* Constraints */ = { + isa = PBXNativeTarget; + buildConfigurationList = A513CCBA21EF9CD400857436 /* Build configuration list for PBXNativeTarget "Constraints" */; + buildPhases = ( + A513CCA421EF9CD000857436 /* Sources */, + A513CCA521EF9CD000857436 /* Frameworks */, + A513CCA621EF9CD000857436 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Constraints; + productName = Constraints; + productReference = A513CCA821EF9CD000857436 /* Constraints.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A513CCA021EF9CD000857436 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A513CCA721EF9CD000857436 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A513CCA321EF9CD000857436 /* Build configuration list for PBXProject "Constraints" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A513CC9F21EF9CD000857436; + productRefGroup = A513CCA921EF9CD000857436 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A513CCA721EF9CD000857436 /* Constraints */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A513CCA621EF9CD000857436 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A513CCB621EF9CD400857436 /* LaunchScreen.storyboard in Resources */, + A513CCB321EF9CD400857436 /* Assets.xcassets in Resources */, + A513CCB121EF9CD000857436 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A513CCA421EF9CD000857436 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A513CCAE21EF9CD000857436 /* ViewController.swift in Sources */, + A513CCAC21EF9CD000857436 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A513CCAF21EF9CD000857436 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A513CCB021EF9CD000857436 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A513CCB421EF9CD400857436 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A513CCB521EF9CD400857436 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A513CCB821EF9CD400857436 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A513CCB921EF9CD400857436 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A513CCBB21EF9CD400857436 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = Constraints/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.Constraints; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A513CCBC21EF9CD400857436 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = Constraints/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.Constraints; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A513CCA321EF9CD000857436 /* Build configuration list for PBXProject "Constraints" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A513CCB821EF9CD400857436 /* Debug */, + A513CCB921EF9CD400857436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A513CCBA21EF9CD400857436 /* Build configuration list for PBXNativeTarget "Constraints" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A513CCBB21EF9CD400857436 /* Debug */, + A513CCBC21EF9CD400857436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A513CCA021EF9CD000857436 /* Project object */; +} diff --git a/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/AppDelegate.swift b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/AppDelegate.swift new file mode 100644 index 00000000..c298419a --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Constraints +// +// Created by Sergey Osipyan on 1/16/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/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 3 - UIView Animation/Constraints/Constraints/Constraints/Assets.xcassets/Contents.json b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/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 3 - UIView Animation/Constraints/Constraints/Constraints/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Base.lproj/Main.storyboard b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Base.lproj/Main.storyboard new file mode 100644 index 00000000..3504db5b --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Base.lproj/Main.storyboard @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Info.plist b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/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 3 - UIView Animation/Constraints/Constraints/Constraints/ViewController.swift b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/ViewController.swift new file mode 100644 index 00000000..1187d15b --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/Constraints/Constraints/Constraints/ViewController.swift @@ -0,0 +1,104 @@ +// +// ViewController.swift +// Constraints +// +// Created by Sergey Osipyan on 1/16/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + + + + override func viewDidLoad() { + super.viewDidLoad() + + let greeenSquare = UIView() + greeenSquare.backgroundColor = .green + view.addSubview(greeenSquare) + greeenSquare.translatesAutoresizingMaskIntoConstraints = false + + let purpleSquare = UIView() + purpleSquare.backgroundColor = .purple + view.addSubview(purpleSquare) + purpleSquare.translatesAutoresizingMaskIntoConstraints = false + + let widthConstraint = NSLayoutConstraint(item: greeenSquare, + attribute: .width, + relatedBy: .equal, + toItem: nil, + attribute: .notAnAttribute, + multiplier: 1.0, + constant: 200.0) + + let heightConstraint = NSLayoutConstraint(item: greeenSquare, + attribute: .height, + relatedBy: .equal, + toItem: greeenSquare, + attribute: .width, + multiplier: 1.0, + constant: 0.0) + + let centerYConstraint = NSLayoutConstraint(item: greeenSquare, + attribute: .centerY, + relatedBy: .equal, + toItem: view, + attribute: .centerY, + multiplier: 1.0, + constant: 0.0) + + let centerXConstraint = NSLayoutConstraint(item: greeenSquare, + attribute: .centerX, + relatedBy: .equal, + toItem: view, + attribute: .centerX, + multiplier: 1.0, + constant: 0.0) + + + NSLayoutConstraint.activate([heightConstraint, widthConstraint, centerXConstraint, centerYConstraint]) + + + + let topConstraintPurpleSquare = NSLayoutConstraint(item: purpleSquare, + attribute: .top, + relatedBy: .equal, + toItem: greeenSquare, + attribute: .bottom, + multiplier: 1.0, + constant: 20.0) + + let widthConstraintPurpleSquare = NSLayoutConstraint(item: purpleSquare, + attribute: .width, + relatedBy: .equal, + toItem: greeenSquare, + attribute: .width, + multiplier: 1.0, + constant: 0.0) + + let bottomConstraintPurpleSquare = NSLayoutConstraint(item: view, + attribute: .bottom, + relatedBy: .equal, + toItem: purpleSquare, + attribute: .bottom, + multiplier: 1.0, + constant: 20.0) + + let centerXConstraintPurpleSquare = NSLayoutConstraint(item: purpleSquare, + attribute: .centerX, + relatedBy: .equal, + toItem: view, + attribute: .centerX, + multiplier: 1.0, + constant: 90.0) + + NSLayoutConstraint.activate([widthConstraintPurpleSquare, topConstraintPurpleSquare , centerXConstraintPurpleSquare, bottomConstraintPurpleSquare]) + + } + + +} + diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation.xcodeproj/project.pbxproj b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation.xcodeproj/project.pbxproj new file mode 100755 index 00000000..5896d923 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A52B73C121E666D8004CD524 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52B73C021E666D8004CD524 /* AppDelegate.swift */; }; + A52B73C321E666D8004CD524 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52B73C221E666D8004CD524 /* ViewController.swift */; }; + A52B73C621E666D8004CD524 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52B73C421E666D8004CD524 /* Main.storyboard */; }; + A52B73C821E666DB004CD524 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A52B73C721E666DB004CD524 /* Assets.xcassets */; }; + A52B73CB21E666DB004CD524 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52B73C921E666DB004CD524 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + A52B73BD21E666D8004CD524 /* UIAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A52B73C021E666D8004CD524 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A52B73C221E666D8004CD524 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + A52B73C521E666D8004CD524 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A52B73C721E666DB004CD524 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A52B73CA21E666DB004CD524 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A52B73CC21E666DB004CD524 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A52B73BA21E666D8004CD524 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A52B73B421E666D8004CD524 = { + isa = PBXGroup; + children = ( + A52B73BF21E666D8004CD524 /* UIAnimation */, + A52B73BE21E666D8004CD524 /* Products */, + ); + sourceTree = ""; + }; + A52B73BE21E666D8004CD524 /* Products */ = { + isa = PBXGroup; + children = ( + A52B73BD21E666D8004CD524 /* UIAnimation.app */, + ); + name = Products; + sourceTree = ""; + }; + A52B73BF21E666D8004CD524 /* UIAnimation */ = { + isa = PBXGroup; + children = ( + A52B73C021E666D8004CD524 /* AppDelegate.swift */, + A52B73C221E666D8004CD524 /* ViewController.swift */, + A52B73C421E666D8004CD524 /* Main.storyboard */, + A52B73C721E666DB004CD524 /* Assets.xcassets */, + A52B73C921E666DB004CD524 /* LaunchScreen.storyboard */, + A52B73CC21E666DB004CD524 /* Info.plist */, + ); + path = UIAnimation; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A52B73BC21E666D8004CD524 /* UIAnimation */ = { + isa = PBXNativeTarget; + buildConfigurationList = A52B73CF21E666DB004CD524 /* Build configuration list for PBXNativeTarget "UIAnimation" */; + buildPhases = ( + A52B73B921E666D8004CD524 /* Sources */, + A52B73BA21E666D8004CD524 /* Frameworks */, + A52B73BB21E666D8004CD524 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = UIAnimation; + productName = UIAnimation; + productReference = A52B73BD21E666D8004CD524 /* UIAnimation.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A52B73B521E666D8004CD524 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A52B73BC21E666D8004CD524 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A52B73B821E666D8004CD524 /* Build configuration list for PBXProject "UIAnimation" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A52B73B421E666D8004CD524; + productRefGroup = A52B73BE21E666D8004CD524 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A52B73BC21E666D8004CD524 /* UIAnimation */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A52B73BB21E666D8004CD524 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52B73CB21E666DB004CD524 /* LaunchScreen.storyboard in Resources */, + A52B73C821E666DB004CD524 /* Assets.xcassets in Resources */, + A52B73C621E666D8004CD524 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A52B73B921E666D8004CD524 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52B73C321E666D8004CD524 /* ViewController.swift in Sources */, + A52B73C121E666D8004CD524 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A52B73C421E666D8004CD524 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A52B73C521E666D8004CD524 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A52B73C921E666DB004CD524 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A52B73CA21E666DB004CD524 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A52B73CD21E666DB004CD524 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A52B73CE21E666DB004CD524 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A52B73D021E666DB004CD524 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = UIAnimation/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.UIAnimation; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A52B73D121E666DB004CD524 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = UIAnimation/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.UIAnimation; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A52B73B821E666D8004CD524 /* Build configuration list for PBXProject "UIAnimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52B73CD21E666DB004CD524 /* Debug */, + A52B73CE21E666DB004CD524 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A52B73CF21E666DB004CD524 /* Build configuration list for PBXNativeTarget "UIAnimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52B73D021E666DB004CD524 /* Debug */, + A52B73D121E666DB004CD524 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A52B73B521E666D8004CD524 /* Project object */; +} diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/AppDelegate.swift b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/AppDelegate.swift new file mode 100755 index 00000000..d9335114 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// UIAnimation +// +// Created by Sergey Osipyan on 1/9/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/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 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Contents.json b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Contents.json new file mode 100755 index 00000000..da4a164c --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/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 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Lambda_Logo_Full.imageset/Contents.json b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Lambda_Logo_Full.imageset/Contents.json new file mode 100755 index 00000000..2a92c756 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Lambda_Logo_Full.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Lambda_Logo_Full.pdf", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf new file mode 100755 index 00000000..3a8651d4 Binary files /dev/null and b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Assets.xcassets/Lambda_Logo_Full.imageset/Lambda_Logo_Full.pdf differ diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Base.lproj/LaunchScreen.storyboard b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Base.lproj/Main.storyboard b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Base.lproj/Main.storyboard new file mode 100755 index 00000000..3f1a6292 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Base.lproj/Main.storyboard @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Info.plist b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/Info.plist new file mode 100755 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/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 3 - UIView Animation/UIAnimation/UIAnimation/ViewController.swift b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/ViewController.swift new file mode 100755 index 00000000..e6368461 --- /dev/null +++ b/Sprint 6/Module 3 - UIView Animation/UIAnimation/UIAnimation/ViewController.swift @@ -0,0 +1,109 @@ +// +// ViewController.swift +// UIAnimation +// +// Created by Sergey Osipyan on 1/9/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + navigationItem.title = "Hello!" + view.addSubview(lambdaLogoImage) + lambdaLogoImage.translatesAutoresizingMaskIntoConstraints = false + } + var animationPerformedOnce = false + + override func viewDidAppear(_ animated: Bool) { + super .viewDidAppear(animated) + + + } + + + @IBOutlet weak var stack: UIStackView! + @IBOutlet weak var L: UILabel! + @IBOutlet weak var a: UILabel! + @IBOutlet weak var m: UILabel! + @IBOutlet weak var b: UILabel! + @IBOutlet weak var d: UILabel! + @IBOutlet weak var lastA: UILabel! + @IBOutlet weak var lambdaLogoImage: UIImageView! + @IBAction func toggle(_ sender: Any) { + if shouldScramble { + animation() + } else { + reset() + } + shouldScramble = !shouldScramble + } + + func randomInt(min: Int, max: Int) -> Int { + return min + Int(arc4random_uniform(UInt32(max - min + 1))) + } + + let randColor: [UIColor] = [.red, .blue, .lightGray, .orange, .green, .brown, .yellow] + + var shouldScramble: Bool = true + var LPosition: CGRect = UILabel().frame + var aPosition: CGRect = UILabel().frame + var mPosition: CGRect = UILabel().frame + var bPosition: CGRect = UILabel().frame + var dPosition: CGRect = UILabel().frame + var lastAPosition: CGRect = UILabel().frame + var labelsArray: [UILabel] = [] + + func animation() { + + let labelArray: [UILabel] = [L, a, m, b, d, lastA] + labelsArray = labelArray + LPosition = L.frame + aPosition = a.frame + mPosition = m.frame + bPosition = b.frame + dPosition = d.frame + lastAPosition = lastA.frame + for label in labelArray { + let randCGFloatX = CGFloat.random(in: 0...340) + let randCGFloatY = CGFloat.random(in: 0...650) + let rect = CGRect(x: randCGFloatX, y: randCGFloatY, width: 50, height: 50) + UIView.animate(withDuration: 3) { + label.textColor = self.randColor[self.randomInt(min: 0, max: 6)].withAlphaComponent(1.0) + label.backgroundColor = self.randColor[self.randomInt(min: 0, max: 6)].withAlphaComponent(0.5) + label.frame = rect + label.transform = CGAffineTransform(scaleX: CGFloat(self.randomInt(min: 1, max: 5)), y: CGFloat(self.randomInt(min: 1, max: 5))) + label.transform = CGAffineTransform(rotationAngle: CGFloat(self.randomInt(min: 1, max: 650))) + self.lambdaLogoImage.alpha = 0 + } + } + } + func reset() { + for label in labelsArray { + + UIView.animate(withDuration: 3) { + label.textColor = .black + label.backgroundColor = UIColor.white.withAlphaComponent(0) + self.L.transform = .identity + self.a.transform = .identity + self.m.transform = .identity + self.b.transform = .identity + self.d.transform = .identity + self.lastA.transform = .identity + + self.L.frame = self.LPosition + self.a.frame = self.aPosition + self.m.frame = self.mPosition + self.b.frame = self.bPosition + self.d.frame = self.dPosition + self.lastA.frame = self.lastAPosition + self.lambdaLogoImage.alpha = 1.0 + self.lambdaLogoImage.transform.inverted() + } + } + } +} + diff --git a/Sprint 6/Module 4 - View Controller Transitions/FriendsAsync.zip b/Sprint 6/Module 4 - View Controller Transitions/FriendsAsync.zip new file mode 100644 index 00000000..7dad290e Binary files /dev/null and b/Sprint 6/Module 4 - View Controller Transitions/FriendsAsync.zip differ diff --git a/Sprint 7/Concurrency II (7.3)/Concurrency II.playground/Contents.swift b/Sprint 7/Concurrency II (7.3)/Concurrency II.playground/Contents.swift new file mode 100644 index 00000000..e6b72325 --- /dev/null +++ b/Sprint 7/Concurrency II (7.3)/Concurrency II.playground/Contents.swift @@ -0,0 +1,109 @@ +import Foundation +import UIKit + +class Spoon { + + var index: Int + + + init(index: Int) { + self.index = index + } + + private let lock = NSLock() + + func pickUp() { + lock.lock() + } + + func putDown() { + lock.unlock() + } + +} + + +class Developer { + + + var leftSpoon: Spoon + var rightSpoon: Spoon + let dev: String + + + init(leftSpoon: Spoon, rightSpoon: Spoon, dev: String) { + self.rightSpoon = rightSpoon + self.leftSpoon = leftSpoon + self.dev = dev + } + + + func think() { + print("\(dev) is thinking ") + if leftSpoon.index < rightSpoon.index { + print("\(dev) is thinking until the left spoon is available") + leftSpoon.pickUp() + print("\(dev) pick up left spoon") + print("\(dev) is thinking until the right spoon is available") + rightSpoon.pickUp() + print("\(dev) pick up right spoon") + + } else { + print("\(dev) is thinking until the right spoon is available") + rightSpoon.pickUp() + print("\(dev) pick up right spoon") + print("\(dev) is thinking until the left spoon is available") + leftSpoon.pickUp() + print("\(dev) pick up left spoon") + + } + } + + func eat() { + + + print("\(dev) is eating") + usleep(useconds_t(Int.random(in: 10000...150_000))) + + rightSpoon.putDown() + print("\(dev) put down right spoon") + + leftSpoon.putDown() + print("\(dev) put down left spoon") + } + + func run() { + + while true { + let startTime = Date() + think() + eat() + let endTime = Date() + let time = endTime.timeIntervalSinceReferenceDate - + startTime.timeIntervalSinceReferenceDate + print("\(dev) eating process takes \(time) seconds") + } + } +} + +let spoon1 = Spoon(index: 1) +let spoon2 = Spoon(index: 2) +let spoon3 = Spoon(index: 3) +let spoon4 = Spoon(index: 4) +let spoon5 = Spoon(index: 5) + +let developer1 = Developer(leftSpoon: spoon1, rightSpoon: spoon2, dev: "don1") +let developer2 = Developer(leftSpoon: spoon2, rightSpoon: spoon3, dev: "dev2") +let developer3 = Developer(leftSpoon: spoon3, rightSpoon: spoon4, dev: "dev3") +let developer4 = Developer(leftSpoon: spoon4, rightSpoon: spoon5, dev: "dev4") +let developer5 = Developer(leftSpoon: spoon5, rightSpoon: spoon1, dev: "dev5") + +let developers = [developer1, developer2, developer3, developer4, developer5] + + +DispatchQueue.concurrentPerform(iterations: 5) { + developers[$0].run() +} + + + diff --git a/Sprint 7/Concurrency II (7.3)/Concurrency II.playground/contents.xcplayground b/Sprint 7/Concurrency II (7.3)/Concurrency II.playground/contents.xcplayground new file mode 100644 index 00000000..9f5f2f40 --- /dev/null +++ b/Sprint 7/Concurrency II (7.3)/Concurrency II.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Sprint 7/Generics (7.2)/GenericChallenge.playground/Contents.swift b/Sprint 7/Generics (7.2)/GenericChallenge.playground/Contents.swift new file mode 100644 index 00000000..ad49e911 --- /dev/null +++ b/Sprint 7/Generics (7.2)/GenericChallenge.playground/Contents.swift @@ -0,0 +1,90 @@ + + + +import UIKit + +struct CountedSet where Element: Hashable { + + + // MARK: - Properties + + private(set) var storage: [Element: Int] = [:] + + var count: Int { + return storage.count + } + + var isEmpty: Bool { + if count == 0 { + return true + } else { + return false + } + } + + + // MARK: - Subscript notation + + subscript(_ element: Element) -> Int { + get { + return storage[element] ?? 0 + } + } + + + // MARK: - Insert and remove + + mutating func insert(_ element: Element) { + guard let int = storage[element] else { + storage[element] = 1 + return + } + storage[element] = int + 1 + } + + mutating func remove(_ element: Element) -> Int { + guard let int = storage[element] else { return 0 } + if int == 1 { + guard let index = storage.index(forKey: element) else { return 0 } + storage.remove(at: index) + return 0 + } + storage[element] = int - 1 + return storage[element] ?? 0 + } +} +extension CountedSet: ExpressibleByArrayLiteral { + init(arrayLiteral: Element...) { + self.init() + for element in arrayLiteral { + self.insert(element) + } + } +} + + + + + +enum Arrow { case iron, wooden, elven, dwarvish, magic, silver } + var aCountedSet = CountedSet() +aCountedSet[.iron] // 0 +var myCountedSet: CountedSet = [.iron, .magic, .iron, .silver, .iron, .iron] + +myCountedSet[.iron] // 4 +myCountedSet.remove(.iron) // 3 +myCountedSet.remove(.dwarvish) // 0 +myCountedSet.remove(.magic) // + + +enum AppleProducts { case iPhone, iPad, iPod, MacBook, AppleTV } + +var appleCountedSet = CountedSet() + +appleCountedSet[.iPhone] +var myAppleCountedSet: CountedSet = [.iPhone, .iPad, .iPod, .iPhone, .iPad, .iPhone, .AppleTV] +myAppleCountedSet[.iPhone] +myAppleCountedSet.remove(.iPhone) +myAppleCountedSet.remove(.MacBook) +myAppleCountedSet.remove(.iPod) +myAppleCountedSet.remove(.iPhone) diff --git a/Sprint 7/Generics (7.2)/GenericChallenge.playground/contents.xcplayground b/Sprint 7/Generics (7.2)/GenericChallenge.playground/contents.xcplayground new file mode 100644 index 00000000..9f5f2f40 --- /dev/null +++ b/Sprint 7/Generics (7.2)/GenericChallenge.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI.xcodeproj/project.pbxproj b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI.xcodeproj/project.pbxproj new file mode 100644 index 00000000..8a180e5b --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI.xcodeproj/project.pbxproj @@ -0,0 +1,478 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A52FC9B42214C2BE0073AF00 /* LoadingUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A52FC9AA2214C2BD0073AF00 /* LoadingUI.framework */; }; + A52FC9B92214C2BE0073AF00 /* LoadingUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52FC9B82214C2BE0073AF00 /* LoadingUITests.swift */; }; + A52FC9BB2214C2BE0073AF00 /* LoadingUI.h in Headers */ = {isa = PBXBuildFile; fileRef = A52FC9AD2214C2BD0073AF00 /* LoadingUI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A52FCA3D2214D4300073AF00 /* LoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52FCA3C2214D4300073AF00 /* LoadingViewController.swift */; }; + A52FCA3F221546AD0073AF00 /* IndeterminateLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52FCA3E221546AD0073AF00 /* IndeterminateLoadingView.swift */; }; + A52FCA41221546B20073AF00 /* PolarPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52FCA40221546B20073AF00 /* PolarPoint.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + A52FC9B52214C2BE0073AF00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A52FC9A12214C2BD0073AF00 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A52FC9A92214C2BD0073AF00; + remoteInfo = LoadingUI; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + A52FC9AA2214C2BD0073AF00 /* LoadingUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LoadingUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A52FC9AD2214C2BD0073AF00 /* LoadingUI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoadingUI.h; sourceTree = ""; }; + A52FC9AE2214C2BD0073AF00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A52FC9B32214C2BE0073AF00 /* LoadingUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LoadingUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A52FC9B82214C2BE0073AF00 /* LoadingUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingUITests.swift; sourceTree = ""; }; + A52FC9BA2214C2BE0073AF00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A52FCA3C2214D4300073AF00 /* LoadingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingViewController.swift; sourceTree = ""; }; + A52FCA3E221546AD0073AF00 /* IndeterminateLoadingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndeterminateLoadingView.swift; sourceTree = ""; }; + A52FCA40221546B20073AF00 /* PolarPoint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PolarPoint.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A52FC9A72214C2BD0073AF00 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A52FC9B02214C2BE0073AF00 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FC9B42214C2BE0073AF00 /* LoadingUI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A52FC9A02214C2BD0073AF00 = { + isa = PBXGroup; + children = ( + A52FC9AC2214C2BD0073AF00 /* LoadingUI */, + A52FC9B72214C2BE0073AF00 /* LoadingUITests */, + A52FC9AB2214C2BD0073AF00 /* Products */, + ); + sourceTree = ""; + }; + A52FC9AB2214C2BD0073AF00 /* Products */ = { + isa = PBXGroup; + children = ( + A52FC9AA2214C2BD0073AF00 /* LoadingUI.framework */, + A52FC9B32214C2BE0073AF00 /* LoadingUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A52FC9AC2214C2BD0073AF00 /* LoadingUI */ = { + isa = PBXGroup; + children = ( + A52FC9AD2214C2BD0073AF00 /* LoadingUI.h */, + A52FC9AE2214C2BD0073AF00 /* Info.plist */, + A52FCA3C2214D4300073AF00 /* LoadingViewController.swift */, + A52FCA40221546B20073AF00 /* PolarPoint.swift */, + A52FCA3E221546AD0073AF00 /* IndeterminateLoadingView.swift */, + ); + path = LoadingUI; + sourceTree = ""; + }; + A52FC9B72214C2BE0073AF00 /* LoadingUITests */ = { + isa = PBXGroup; + children = ( + A52FC9B82214C2BE0073AF00 /* LoadingUITests.swift */, + A52FC9BA2214C2BE0073AF00 /* Info.plist */, + ); + path = LoadingUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + A52FC9A52214C2BD0073AF00 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FC9BB2214C2BE0073AF00 /* LoadingUI.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + A52FC9A92214C2BD0073AF00 /* LoadingUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = A52FC9BE2214C2BE0073AF00 /* Build configuration list for PBXNativeTarget "LoadingUI" */; + buildPhases = ( + A52FC9A52214C2BD0073AF00 /* Headers */, + A52FC9A62214C2BD0073AF00 /* Sources */, + A52FC9A72214C2BD0073AF00 /* Frameworks */, + A52FC9A82214C2BD0073AF00 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LoadingUI; + productName = LoadingUI; + productReference = A52FC9AA2214C2BD0073AF00 /* LoadingUI.framework */; + productType = "com.apple.product-type.framework"; + }; + A52FC9B22214C2BE0073AF00 /* LoadingUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A52FC9C12214C2BE0073AF00 /* Build configuration list for PBXNativeTarget "LoadingUITests" */; + buildPhases = ( + A52FC9AF2214C2BE0073AF00 /* Sources */, + A52FC9B02214C2BE0073AF00 /* Frameworks */, + A52FC9B12214C2BE0073AF00 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A52FC9B62214C2BE0073AF00 /* PBXTargetDependency */, + ); + name = LoadingUITests; + productName = LoadingUITests; + productReference = A52FC9B32214C2BE0073AF00 /* LoadingUITests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A52FC9A12214C2BD0073AF00 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A52FC9A92214C2BD0073AF00 = { + CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1010; + }; + A52FC9B22214C2BE0073AF00 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = A52FC9A42214C2BD0073AF00 /* Build configuration list for PBXProject "LoadingUI" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = A52FC9A02214C2BD0073AF00; + productRefGroup = A52FC9AB2214C2BD0073AF00 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A52FC9A92214C2BD0073AF00 /* LoadingUI */, + A52FC9B22214C2BE0073AF00 /* LoadingUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A52FC9A82214C2BD0073AF00 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A52FC9B12214C2BE0073AF00 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A52FC9A62214C2BD0073AF00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FCA41221546B20073AF00 /* PolarPoint.swift in Sources */, + A52FCA3D2214D4300073AF00 /* LoadingViewController.swift in Sources */, + A52FCA3F221546AD0073AF00 /* IndeterminateLoadingView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A52FC9AF2214C2BE0073AF00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FC9B92214C2BE0073AF00 /* LoadingUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + A52FC9B62214C2BE0073AF00 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A52FC9A92214C2BD0073AF00 /* LoadingUI */; + targetProxy = A52FC9B52214C2BE0073AF00 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + A52FC9BC2214C2BE0073AF00 /* 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 = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A52FC9BD2214C2BE0073AF00 /* 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 = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + A52FC9BF2214C2BE0073AF00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = KF4QEGAU36; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = LoadingUI/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUI; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A52FC9C02214C2BE0073AF00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = KF4QEGAU36; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = LoadingUI/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUI; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + A52FC9C22214C2BE0073AF00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = LoadingUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A52FC9C32214C2BE0073AF00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = LoadingUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A52FC9A42214C2BD0073AF00 /* Build configuration list for PBXProject "LoadingUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52FC9BC2214C2BE0073AF00 /* Debug */, + A52FC9BD2214C2BE0073AF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A52FC9BE2214C2BE0073AF00 /* Build configuration list for PBXNativeTarget "LoadingUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52FC9BF2214C2BE0073AF00 /* Debug */, + A52FC9C02214C2BE0073AF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A52FC9C12214C2BE0073AF00 /* Build configuration list for PBXNativeTarget "LoadingUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52FC9C22214C2BE0073AF00 /* Debug */, + A52FC9C32214C2BE0073AF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A52FC9A12214C2BD0073AF00 /* Project object */; +} diff --git a/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/IndeterminateLoadingView.swift similarity index 98% rename from Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift rename to Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/IndeterminateLoadingView.swift index 18a7145d..39ce0e7c 100644 --- a/Sprint 9/Creating Frameworks/IndeterminateLoadingView.swift +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/IndeterminateLoadingView.swift @@ -41,7 +41,7 @@ class IndeterminateLoadingView: UIView, CAAnimationDelegate { let thickness: CGFloat = 10.0 shapeLayer.frame = layer.bounds - shapeLayer.strokeColor = UIColor.black.cgColor + shapeLayer.strokeColor = UIColor.gray.cgColor shapeLayer.fillColor = UIColor.clear.cgColor shapeLayer.lineWidth = thickness shapeLayer.strokeStart = 0.0 diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/Info.plist new file mode 100644 index 00000000..e1fe4cfb --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/Info.plist @@ -0,0 +1,22 @@ + + + + + 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) + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/LoadingUI.h b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/LoadingUI.h new file mode 100644 index 00000000..fb436101 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/LoadingUI.h @@ -0,0 +1,19 @@ +// +// LoadingUI.h +// LoadingUI +// +// Created by Sergey Osipyan on 2/13/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +#import + +//! Project version number for LoadingUI. +FOUNDATION_EXPORT double LoadingUIVersionNumber; + +//! Project version string for LoadingUI. +FOUNDATION_EXPORT const unsigned char LoadingUIVersionString[]; + +// 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/LoadingUI/LoadingUI/LoadingViewController.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/LoadingViewController.swift new file mode 100644 index 00000000..ca5f1510 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/LoadingViewController.swift @@ -0,0 +1,26 @@ +// +// LoadingViewController.swift +// LoadingUI +// +// Created by Sergey Osipyan on 2/13/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import Foundation + +open class LoadingViewController: UIViewController { + + + var weel = IndeterminateLoadingView() + + override open func viewDidLoad() { + super.viewDidLoad() + + weel = IndeterminateLoadingView(frame: CGRect(x: view.center.x - 50, y: view.center.y - 175, width: 100, height: 100)) + weel.center = view.center + weel.startAnimating() + view.addSubview(weel) + + } + +} diff --git a/Sprint 9/Creating Frameworks/PolarPoint.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/PolarPoint.swift similarity index 99% rename from Sprint 9/Creating Frameworks/PolarPoint.swift rename to Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/PolarPoint.swift index 5964e734..b192706b 100644 --- a/Sprint 9/Creating Frameworks/PolarPoint.swift +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUI/PolarPoint.swift @@ -6,6 +6,7 @@ // import Foundation +import UIKit struct PolarPoint { diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUITests/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUITests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUITests/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/LoadingUI/LoadingUITests/LoadingUITests.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUITests/LoadingUITests.swift new file mode 100644 index 00000000..76c45257 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUI/LoadingUITests/LoadingUITests.swift @@ -0,0 +1,34 @@ +// +// LoadingUITests.swift +// LoadingUITests +// +// Created by Sergey Osipyan on 2/13/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import XCTest +@testable import LoadingUI + +class LoadingUITests: XCTestCase { + + override func 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. + } + + 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/LoadingUITest/LoadingUITest.xcodeproj/project.pbxproj b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest.xcodeproj/project.pbxproj new file mode 100644 index 00000000..39cf8f6f --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest.xcodeproj/project.pbxproj @@ -0,0 +1,545 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + A52FCA022214C8670073AF00 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52FCA012214C8670073AF00 /* AppDelegate.swift */; }; + A52FCA072214C8670073AF00 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52FCA052214C8670073AF00 /* Main.storyboard */; }; + A52FCA092214C8680073AF00 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A52FCA082214C8680073AF00 /* Assets.xcassets */; }; + A52FCA0C2214C8680073AF00 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A52FCA0A2214C8680073AF00 /* LaunchScreen.storyboard */; }; + A52FCA172214C8680073AF00 /* LoadingUITestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52FCA162214C8680073AF00 /* LoadingUITestTests.swift */; }; + A52FCA332214C9070073AF00 /* LoadingUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A52FCA302214C8FF0073AF00 /* LoadingUI.framework */; }; + A52FCA342214C9070073AF00 /* LoadingUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A52FCA302214C8FF0073AF00 /* LoadingUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + A52FCA132214C8680073AF00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A52FC9F62214C8670073AF00 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A52FC9FD2214C8670073AF00; + remoteInfo = LoadingUITest; + }; + A52FCA2F2214C8FF0073AF00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A52FCA2A2214C8FF0073AF00 /* LoadingUI.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A52FC9AA2214C2BD0073AF00; + remoteInfo = LoadingUI; + }; + A52FCA312214C8FF0073AF00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A52FCA2A2214C8FF0073AF00 /* LoadingUI.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A52FC9B32214C2BE0073AF00; + remoteInfo = LoadingUITests; + }; + A52FCA352214C9070073AF00 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A52FCA2A2214C8FF0073AF00 /* LoadingUI.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A52FC9A92214C2BD0073AF00; + remoteInfo = LoadingUI; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + A52FCA372214C9070073AF00 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A52FCA342214C9070073AF00 /* LoadingUI.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + A52FC9FE2214C8670073AF00 /* LoadingUITest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LoadingUITest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A52FCA012214C8670073AF00 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A52FCA062214C8670073AF00 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + A52FCA082214C8680073AF00 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A52FCA0B2214C8680073AF00 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + A52FCA0D2214C8680073AF00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A52FCA122214C8680073AF00 /* LoadingUITestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LoadingUITestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A52FCA162214C8680073AF00 /* LoadingUITestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingUITestTests.swift; sourceTree = ""; }; + A52FCA182214C8680073AF00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A52FCA2A2214C8FF0073AF00 /* LoadingUI.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = LoadingUI.xcodeproj; path = ../LoadingUI/LoadingUI.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A52FC9FB2214C8670073AF00 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FCA332214C9070073AF00 /* LoadingUI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A52FCA0F2214C8680073AF00 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A52FC9F52214C8670073AF00 = { + isa = PBXGroup; + children = ( + A52FCA002214C8670073AF00 /* LoadingUITest */, + A52FCA152214C8680073AF00 /* LoadingUITestTests */, + A52FC9FF2214C8670073AF00 /* Products */, + A52FCA2A2214C8FF0073AF00 /* LoadingUI.xcodeproj */, + ); + sourceTree = ""; + }; + A52FC9FF2214C8670073AF00 /* Products */ = { + isa = PBXGroup; + children = ( + A52FC9FE2214C8670073AF00 /* LoadingUITest.app */, + A52FCA122214C8680073AF00 /* LoadingUITestTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + A52FCA002214C8670073AF00 /* LoadingUITest */ = { + isa = PBXGroup; + children = ( + A52FCA012214C8670073AF00 /* AppDelegate.swift */, + A52FCA052214C8670073AF00 /* Main.storyboard */, + A52FCA082214C8680073AF00 /* Assets.xcassets */, + A52FCA0A2214C8680073AF00 /* LaunchScreen.storyboard */, + A52FCA0D2214C8680073AF00 /* Info.plist */, + ); + path = LoadingUITest; + sourceTree = ""; + }; + A52FCA152214C8680073AF00 /* LoadingUITestTests */ = { + isa = PBXGroup; + children = ( + A52FCA162214C8680073AF00 /* LoadingUITestTests.swift */, + A52FCA182214C8680073AF00 /* Info.plist */, + ); + path = LoadingUITestTests; + sourceTree = ""; + }; + A52FCA2B2214C8FF0073AF00 /* Products */ = { + isa = PBXGroup; + children = ( + A52FCA302214C8FF0073AF00 /* LoadingUI.framework */, + A52FCA322214C8FF0073AF00 /* LoadingUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A52FC9FD2214C8670073AF00 /* LoadingUITest */ = { + isa = PBXNativeTarget; + buildConfigurationList = A52FCA1B2214C8690073AF00 /* Build configuration list for PBXNativeTarget "LoadingUITest" */; + buildPhases = ( + A52FC9FA2214C8670073AF00 /* Sources */, + A52FC9FB2214C8670073AF00 /* Frameworks */, + A52FC9FC2214C8670073AF00 /* Resources */, + A52FCA372214C9070073AF00 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + A52FCA362214C9070073AF00 /* PBXTargetDependency */, + ); + name = LoadingUITest; + productName = LoadingUITest; + productReference = A52FC9FE2214C8670073AF00 /* LoadingUITest.app */; + productType = "com.apple.product-type.application"; + }; + A52FCA112214C8680073AF00 /* LoadingUITestTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A52FCA1E2214C8690073AF00 /* Build configuration list for PBXNativeTarget "LoadingUITestTests" */; + buildPhases = ( + A52FCA0E2214C8680073AF00 /* Sources */, + A52FCA0F2214C8680073AF00 /* Frameworks */, + A52FCA102214C8680073AF00 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A52FCA142214C8680073AF00 /* PBXTargetDependency */, + ); + name = LoadingUITestTests; + productName = LoadingUITestTests; + productReference = A52FCA122214C8680073AF00 /* LoadingUITestTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A52FC9F62214C8670073AF00 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Sergey Osipyan"; + TargetAttributes = { + A52FC9FD2214C8670073AF00 = { + CreatedOnToolsVersion = 10.1; + }; + A52FCA112214C8680073AF00 = { + CreatedOnToolsVersion = 10.1; + TestTargetID = A52FC9FD2214C8670073AF00; + }; + }; + }; + buildConfigurationList = A52FC9F92214C8670073AF00 /* Build configuration list for PBXProject "LoadingUITest" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = A52FC9F52214C8670073AF00; + productRefGroup = A52FC9FF2214C8670073AF00 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = A52FCA2B2214C8FF0073AF00 /* Products */; + ProjectRef = A52FCA2A2214C8FF0073AF00 /* LoadingUI.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + A52FC9FD2214C8670073AF00 /* LoadingUITest */, + A52FCA112214C8680073AF00 /* LoadingUITestTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + A52FCA302214C8FF0073AF00 /* LoadingUI.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = LoadingUI.framework; + remoteRef = A52FCA2F2214C8FF0073AF00 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + A52FCA322214C8FF0073AF00 /* LoadingUITests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = LoadingUITests.xctest; + remoteRef = A52FCA312214C8FF0073AF00 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + A52FC9FC2214C8670073AF00 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FCA0C2214C8680073AF00 /* LaunchScreen.storyboard in Resources */, + A52FCA092214C8680073AF00 /* Assets.xcassets in Resources */, + A52FCA072214C8670073AF00 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A52FCA102214C8680073AF00 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A52FC9FA2214C8670073AF00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FCA022214C8670073AF00 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A52FCA0E2214C8680073AF00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A52FCA172214C8680073AF00 /* LoadingUITestTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + A52FCA142214C8680073AF00 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A52FC9FD2214C8670073AF00 /* LoadingUITest */; + targetProxy = A52FCA132214C8680073AF00 /* PBXContainerItemProxy */; + }; + A52FCA362214C9070073AF00 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = LoadingUI; + targetProxy = A52FCA352214C9070073AF00 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + A52FCA052214C8670073AF00 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A52FCA062214C8670073AF00 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + A52FCA0A2214C8680073AF00 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A52FCA0B2214C8680073AF00 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A52FCA192214C8690073AF00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + A52FCA1A2214C8690073AF00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + A52FCA1C2214C8690073AF00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = LoadingUITest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUITest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A52FCA1D2214C8690073AF00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = LoadingUITest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUITest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + A52FCA1F2214C8690073AF00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = LoadingUITestTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUITestTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LoadingUITest.app/LoadingUITest"; + }; + name = Debug; + }; + A52FCA202214C8690073AF00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = KF4QEGAU36; + INFOPLIST_FILE = LoadingUITestTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Sergey.LoadingUITestTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LoadingUITest.app/LoadingUITest"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A52FC9F92214C8670073AF00 /* Build configuration list for PBXProject "LoadingUITest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52FCA192214C8690073AF00 /* Debug */, + A52FCA1A2214C8690073AF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A52FCA1B2214C8690073AF00 /* Build configuration list for PBXNativeTarget "LoadingUITest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52FCA1C2214C8690073AF00 /* Debug */, + A52FCA1D2214C8690073AF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A52FCA1E2214C8690073AF00 /* Build configuration list for PBXNativeTarget "LoadingUITestTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A52FCA1F2214C8690073AF00 /* Debug */, + A52FCA202214C8690073AF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A52FC9F62214C8670073AF00 /* Project object */; +} diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/AppDelegate.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/AppDelegate.swift new file mode 100644 index 00000000..024b942a --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// LoadingUITest +// +// Created by Sergey Osipyan on 2/13/19. +// Copyright © 2019 Sergey Osipyan. 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/LoadingUITest/LoadingUITest/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/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/LoadingUITest/LoadingUITest/Assets.xcassets/Contents.json b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/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/LoadingUITest/LoadingUITest/Base.lproj/LaunchScreen.storyboard b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..bfa36129 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Base.lproj/Main.storyboard b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Base.lproj/Main.storyboard new file mode 100644 index 00000000..15d67d9f --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Base.lproj/Main.storyboard @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/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/LoadingUITest/LoadingUITest/LoadingUI.gif b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/LoadingUI.gif new file mode 100644 index 00000000..708fa94c Binary files /dev/null and b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITest/LoadingUI.gif differ diff --git a/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITestTests/Info.plist b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITestTests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITestTests/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/LoadingUITest/LoadingUITestTests/LoadingUITestTests.swift b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITestTests/LoadingUITestTests.swift new file mode 100644 index 00000000..e616a5f1 --- /dev/null +++ b/Sprint 9/Creating Frameworks/LoadingUIFrameworkDevelopment/LoadingUITest/LoadingUITestTests/LoadingUITestTests.swift @@ -0,0 +1,34 @@ +// +// LoadingUITestTests.swift +// LoadingUITestTests +// +// Created by Sergey Osipyan on 2/13/19. +// Copyright © 2019 Sergey Osipyan. All rights reserved. +// + +import XCTest +@testable import LoadingUITest + +class LoadingUITestTests: XCTestCase { + + override func 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. + } + + 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. + } + } + +}