diff --git a/README.md b/README.md index 8bc5c03..a9a6c81 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,11 @@ I'm currently seeking freelance, remote opportunities as an iOS developer! If yo - **Day 58:** [_Project 12: Core Data_ (Part Two)](./day-058/) - **Day 59:** [_Project 12: Core Data_ (Part Three)](./day-059/) - **Day 60:** [Milestone for Projects 10-12 (Part One)](./day-060/) +- **Day 61:** [Milestone for Projects 10-12 (Part Two)](./day-061/) -- **Day 61:** [Milestone for Projects 10-12 (Part Two)](./day-061/) +- **Day 62:** [_Project 13: Instafilter_ (Part One)](./day-062/) @@ -170,7 +171,6 @@ I'm currently seeking freelance, remote opportunities as an iOS developer! If yo - [Milestone Project 4: SpaceX Payload Stats](./day-060/Project/SpaceXPayloadStats/) -
diff --git a/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.pbxproj b/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8b7be51 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.pbxproj @@ -0,0 +1,367 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + F352424E238F3F18009DF1F9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F352424D238F3F18009DF1F9 /* AppDelegate.swift */; }; + F3524250238F3F18009DF1F9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F352424F238F3F18009DF1F9 /* SceneDelegate.swift */; }; + F3524254238F3F19009DF1F9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3524253238F3F19009DF1F9 /* Assets.xcassets */; }; + F3524257238F3F19009DF1F9 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3524256238F3F19009DF1F9 /* Preview Assets.xcassets */; }; + F352425A238F3F19009DF1F9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3524258238F3F19009DF1F9 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + F352424A238F3F18009DF1F9 /* Instafilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Instafilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F352424D238F3F18009DF1F9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + F352424F238F3F18009DF1F9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + F3524253238F3F19009DF1F9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F3524256238F3F19009DF1F9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + F3524259238F3F19009DF1F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + F352425B238F3F19009DF1F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F3524247238F3F18009DF1F9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F3524241238F3F18009DF1F9 = { + isa = PBXGroup; + children = ( + F352424C238F3F18009DF1F9 /* Instafilter */, + F352424B238F3F18009DF1F9 /* Products */, + ); + sourceTree = ""; + }; + F352424B238F3F18009DF1F9 /* Products */ = { + isa = PBXGroup; + children = ( + F352424A238F3F18009DF1F9 /* Instafilter.app */, + ); + name = Products; + sourceTree = ""; + }; + F352424C238F3F18009DF1F9 /* Instafilter */ = { + isa = PBXGroup; + children = ( + F352425B238F3F19009DF1F9 /* Info.plist */, + F352424D238F3F18009DF1F9 /* AppDelegate.swift */, + F352424F238F3F18009DF1F9 /* SceneDelegate.swift */, + F3524258238F3F19009DF1F9 /* LaunchScreen.storyboard */, + F3524255238F3F19009DF1F9 /* Preview Content */, + F3524264238F45FC009DF1F9 /* Resources */, + F3524262238F45CD009DF1F9 /* Reusables */, + F3524261238F45C9009DF1F9 /* Scenes */, + ); + path = Instafilter; + sourceTree = ""; + }; + F3524255238F3F19009DF1F9 /* Preview Content */ = { + isa = PBXGroup; + children = ( + F3524256238F3F19009DF1F9 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + F3524261238F45C9009DF1F9 /* Scenes */ = { + isa = PBXGroup; + children = ( + ); + path = Scenes; + sourceTree = ""; + }; + F3524262238F45CD009DF1F9 /* Reusables */ = { + isa = PBXGroup; + children = ( + ); + path = Reusables; + sourceTree = ""; + }; + F3524264238F45FC009DF1F9 /* Resources */ = { + isa = PBXGroup; + children = ( + F3524253238F3F19009DF1F9 /* Assets.xcassets */, + ); + path = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F3524249238F3F18009DF1F9 /* Instafilter */ = { + isa = PBXNativeTarget; + buildConfigurationList = F352425E238F3F19009DF1F9 /* Build configuration list for PBXNativeTarget "Instafilter" */; + buildPhases = ( + F3524246238F3F18009DF1F9 /* Sources */, + F3524247238F3F18009DF1F9 /* Frameworks */, + F3524248238F3F18009DF1F9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Instafilter; + productName = Instafilter; + productReference = F352424A238F3F18009DF1F9 /* Instafilter.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F3524242238F3F18009DF1F9 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1120; + LastUpgradeCheck = 1120; + ORGANIZATIONNAME = CypherPoet; + TargetAttributes = { + F3524249238F3F18009DF1F9 = { + CreatedOnToolsVersion = 11.2.1; + }; + }; + }; + buildConfigurationList = F3524245238F3F18009DF1F9 /* Build configuration list for PBXProject "Instafilter" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F3524241238F3F18009DF1F9; + productRefGroup = F352424B238F3F18009DF1F9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F3524249238F3F18009DF1F9 /* Instafilter */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F3524248238F3F18009DF1F9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F352425A238F3F19009DF1F9 /* LaunchScreen.storyboard in Resources */, + F3524257238F3F19009DF1F9 /* Preview Assets.xcassets in Resources */, + F3524254238F3F19009DF1F9 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F3524246238F3F18009DF1F9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F352424E238F3F18009DF1F9 /* AppDelegate.swift in Sources */, + F3524250238F3F18009DF1F9 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + F3524258238F3F19009DF1F9 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F3524259238F3F19009DF1F9 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F352425C238F3F19009DF1F9 /* 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; + 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 = 13.2; + 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; + }; + F352425D238F3F19009DF1F9 /* 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; + 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 = 13.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F352425F238F3F19009DF1F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"Instafilter/Preview Content\""; + DEVELOPMENT_TEAM = QRXXH2RKAG; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Instafilter/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.github.cypherpoet.Instafilter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F3524260238F3F19009DF1F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"Instafilter/Preview Content\""; + DEVELOPMENT_TEAM = QRXXH2RKAG; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = Instafilter/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.github.cypherpoet.Instafilter; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F3524245238F3F18009DF1F9 /* Build configuration list for PBXProject "Instafilter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F352425C238F3F19009DF1F9 /* Debug */, + F352425D238F3F19009DF1F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F352425E238F3F19009DF1F9 /* Build configuration list for PBXNativeTarget "Instafilter" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F352425F238F3F19009DF1F9 /* Debug */, + F3524260238F3F19009DF1F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F3524242238F3F18009DF1F9 /* Project object */; +} diff --git a/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7a8b225 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/day-062/Projects/Instafilter/Instafilter/AppDelegate.swift b/day-062/Projects/Instafilter/Instafilter/AppDelegate.swift new file mode 100644 index 0000000..4bad33c --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// Instafilter +// +// Created by Brian Sipple on 11/27/19. +// Copyright © 2019 CypherPoet. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/day-062/Projects/Instafilter/Instafilter/Base.lproj/LaunchScreen.storyboard b/day-062/Projects/Instafilter/Instafilter/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/day-062/Projects/Instafilter/Instafilter/Info.plist b/day-062/Projects/Instafilter/Instafilter/Info.plist new file mode 100644 index 0000000..9742bf0 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/day-062/Projects/Instafilter/Instafilter/Preview Content/Preview Assets.xcassets/Contents.json b/day-062/Projects/Instafilter/Instafilter/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/day-062/Projects/Instafilter/Instafilter/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/day-062/Projects/Instafilter/Instafilter/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/day-062/Projects/Instafilter/Instafilter/Resources/Assets.xcassets/Contents.json b/day-062/Projects/Instafilter/Instafilter/Resources/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/Resources/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/day-062/Projects/Instafilter/Instafilter/SceneDelegate.swift b/day-062/Projects/Instafilter/Instafilter/SceneDelegate.swift new file mode 100644 index 0000000..15de4b7 --- /dev/null +++ b/day-062/Projects/Instafilter/Instafilter/SceneDelegate.swift @@ -0,0 +1,68 @@ +// +// SceneDelegate.swift +// Instafilter +// +// Created by Brian Sipple on 11/27/19. +// Copyright © 2019 CypherPoet. All rights reserved. +// + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + + // Create the SwiftUI view that provides the window contents. + let entryView = EmptyView() + .accentColor(.pink) + + window.rootViewController = UIHostingController(rootView: entryView) + + self.window = window + window.makeKeyAndVisible() + } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/day-062/README.md b/day-062/README.md new file mode 100644 index 0000000..0c90515 --- /dev/null +++ b/day-062/README.md @@ -0,0 +1,105 @@ +# Day 62: _Project 13: Instafilter_ (Part One) + +_Follow along at https://www.hackingwithswift.com/100/swiftui/62_. + +
+ + +# 📒 Field Notes + +This day covers Part One of _`Project 13: Instafilter`_ in the [100 Days of SwiftUI Challenge](https://www.hackingwithswift.com/100/swiftui/62). + +It focuses on several specific topics: + +- Instafilter: Introduction +- How property wrappers become structs +- Creating custom bindings in SwiftUI +- Showing multiple options with ActionSheet + + + + +## Instafilter: Introduction + +From the description: + +> In this project we’re going to build an app that lets the user import photos from their library, then modify them using various image effects. We’ll cover a number of new techniques, but at the center of it all are one useful app development skill – using Apple’s Core Image framework – and one important SwiftUI skill – integrating with UIKit. There are other things too, but those two are the big takeaways. + + + +## How property wrappers become structs + + +`@State` property wrappers wrap their properties in a struct under the hood. That's because they have the following type declaration: + +```swift +@propertyWrapper public struct State : DynamicProperty {} +``` + +This is important, because if means the following code won't work as expected: + +```swift +@State private var blurAmount: CGFloat = 0 { + didSet { + print("New value is \(blurAmount)") + } +} +``` + +`didSet` won't run when our `View`'s `blurAmount` changes, because what it's actually saying "When the State struct wrapping `blurAmount` changes, print out the new blur amount". + +If we truly need the behavior depicted above, one solution is to leverage custom bindings... + + +## Creating custom bindings in SwiftUI + +Custom bindings can serve as a "pass-through" to changes that occur to a View's state: + +```swift +struct ContentView: View { + @State private var blurAmount: CGFloat = 0 + + var body: some View { + let blur = Binding( + get: { + self.blurAmount + }, + set: { + self.blurAmount = $0 + print("New value is \(self.blurAmount)") + } + ) + + return VStack { + Text("Hello, World!") + .blur(radius: blurAmount) + + Slider(value: blur, in: 0...20) + } + } +} +``` + + + + +## Showing multiple options with ActionSheet + +While visually distinct, `ActionSheet`s are alot like `Alert`s with respect to the way we declare them as a modifier on a SwiftUI View. + +As hinted at by their name, `ActionSheet`s can also be much more extensive than `Alert`s -- taking any number of buttons in their constructor: + +```swift +.actionSheet(isPresented: $isShowingActionSheet) { + ActionSheet( + title: Text("Change background"), + message: Text("Select a new color"), + buttons: [ + .default(Text("Red")) { self.backgroundColor = .red }, + .default(Text("Green")) { self.backgroundColor = .green }, + .default(Text("Blue")) { self.backgroundColor = .blue }, + .cancel(), + ] + ) +} +```