diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.pbxproj b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.pbxproj new file mode 100644 index 00000000..92eaac09 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.pbxproj @@ -0,0 +1,474 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 2A6F2AC924817B1E00ED215A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2AC824817B1E00ED215A /* AppDelegate.swift */; }; + 2A6F2ACB24817B1E00ED215A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2ACA24817B1E00ED215A /* SceneDelegate.swift */; }; + 2A6F2ACD24817B1E00ED215A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2ACC24817B1E00ED215A /* ContentView.swift */; }; + 2A6F2ACF24817B1F00ED215A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A6F2ACE24817B1F00ED215A /* Assets.xcassets */; }; + 2A6F2AD224817B1F00ED215A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A6F2AD124817B1F00ED215A /* Preview Assets.xcassets */; }; + 2A6F2AD524817B1F00ED215A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A6F2AD324817B1F00ED215A /* LaunchScreen.storyboard */; }; + 2A6F2AE024817B1F00ED215A /* CombineSchedulersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2ADF24817B1F00ED215A /* CombineSchedulersTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 2A6F2ADC24817B1F00ED215A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2A6F2ABD24817B1E00ED215A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2A6F2AC424817B1E00ED215A; + remoteInfo = CombineSchedulers; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 2A6F2AC524817B1E00ED215A /* CombineSchedulers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CombineSchedulers.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A6F2AC824817B1E00ED215A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 2A6F2ACA24817B1E00ED215A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 2A6F2ACC24817B1E00ED215A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 2A6F2ACE24817B1F00ED215A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 2A6F2AD124817B1F00ED215A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2A6F2AD424817B1F00ED215A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 2A6F2AD624817B1F00ED215A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2A6F2ADB24817B1F00ED215A /* CombineSchedulersTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CombineSchedulersTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A6F2ADF24817B1F00ED215A /* CombineSchedulersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombineSchedulersTests.swift; sourceTree = ""; }; + 2A6F2AE124817B1F00ED215A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2A6F2AC224817B1E00ED215A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2A6F2AD824817B1F00ED215A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2A6F2ABC24817B1E00ED215A = { + isa = PBXGroup; + children = ( + 2A6F2AC724817B1E00ED215A /* CombineSchedulers */, + 2A6F2ADE24817B1F00ED215A /* CombineSchedulersTests */, + 2A6F2AC624817B1E00ED215A /* Products */, + ); + sourceTree = ""; + }; + 2A6F2AC624817B1E00ED215A /* Products */ = { + isa = PBXGroup; + children = ( + 2A6F2AC524817B1E00ED215A /* CombineSchedulers.app */, + 2A6F2ADB24817B1F00ED215A /* CombineSchedulersTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 2A6F2AC724817B1E00ED215A /* CombineSchedulers */ = { + isa = PBXGroup; + children = ( + 2A6F2AC824817B1E00ED215A /* AppDelegate.swift */, + 2A6F2ACA24817B1E00ED215A /* SceneDelegate.swift */, + 2A6F2ACC24817B1E00ED215A /* ContentView.swift */, + 2A6F2ACE24817B1F00ED215A /* Assets.xcassets */, + 2A6F2AD324817B1F00ED215A /* LaunchScreen.storyboard */, + 2A6F2AD624817B1F00ED215A /* Info.plist */, + 2A6F2AD024817B1F00ED215A /* Preview Content */, + ); + path = CombineSchedulers; + sourceTree = ""; + }; + 2A6F2AD024817B1F00ED215A /* Preview Content */ = { + isa = PBXGroup; + children = ( + 2A6F2AD124817B1F00ED215A /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 2A6F2ADE24817B1F00ED215A /* CombineSchedulersTests */ = { + isa = PBXGroup; + children = ( + 2A6F2ADF24817B1F00ED215A /* CombineSchedulersTests.swift */, + 2A6F2AE124817B1F00ED215A /* Info.plist */, + ); + path = CombineSchedulersTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2A6F2AC424817B1E00ED215A /* CombineSchedulers */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2A6F2AE424817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulers" */; + buildPhases = ( + 2A6F2AC124817B1E00ED215A /* Sources */, + 2A6F2AC224817B1E00ED215A /* Frameworks */, + 2A6F2AC324817B1E00ED215A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CombineSchedulers; + productName = CombineSchedulers; + productReference = 2A6F2AC524817B1E00ED215A /* CombineSchedulers.app */; + productType = "com.apple.product-type.application"; + }; + 2A6F2ADA24817B1F00ED215A /* CombineSchedulersTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2A6F2AE724817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulersTests" */; + buildPhases = ( + 2A6F2AD724817B1F00ED215A /* Sources */, + 2A6F2AD824817B1F00ED215A /* Frameworks */, + 2A6F2AD924817B1F00ED215A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 2A6F2ADD24817B1F00ED215A /* PBXTargetDependency */, + ); + name = CombineSchedulersTests; + productName = CombineSchedulersTests; + productReference = 2A6F2ADB24817B1F00ED215A /* CombineSchedulersTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2A6F2ABD24817B1E00ED215A /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1150; + LastUpgradeCheck = 1150; + ORGANIZATIONNAME = "Point-Free"; + TargetAttributes = { + 2A6F2AC424817B1E00ED215A = { + CreatedOnToolsVersion = 11.5; + }; + 2A6F2ADA24817B1F00ED215A = { + CreatedOnToolsVersion = 11.5; + TestTargetID = 2A6F2AC424817B1E00ED215A; + }; + }; + }; + buildConfigurationList = 2A6F2AC024817B1E00ED215A /* Build configuration list for PBXProject "CombineSchedulers" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 2A6F2ABC24817B1E00ED215A; + productRefGroup = 2A6F2AC624817B1E00ED215A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2A6F2AC424817B1E00ED215A /* CombineSchedulers */, + 2A6F2ADA24817B1F00ED215A /* CombineSchedulersTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2A6F2AC324817B1E00ED215A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6F2AD524817B1F00ED215A /* LaunchScreen.storyboard in Resources */, + 2A6F2AD224817B1F00ED215A /* Preview Assets.xcassets in Resources */, + 2A6F2ACF24817B1F00ED215A /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2A6F2AD924817B1F00ED215A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2A6F2AC124817B1E00ED215A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6F2AC924817B1E00ED215A /* AppDelegate.swift in Sources */, + 2A6F2ACB24817B1E00ED215A /* SceneDelegate.swift in Sources */, + 2A6F2ACD24817B1E00ED215A /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2A6F2AD724817B1F00ED215A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6F2AE024817B1F00ED215A /* CombineSchedulersTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 2A6F2ADD24817B1F00ED215A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2A6F2AC424817B1E00ED215A /* CombineSchedulers */; + targetProxy = 2A6F2ADC24817B1F00ED215A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 2A6F2AD324817B1F00ED215A /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 2A6F2AD424817B1F00ED215A /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 2A6F2AE224817B1F00ED215A /* 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.5; + 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; + }; + 2A6F2AE324817B1F00ED215A /* 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.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2A6F2AE524817B1F00ED215A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"CombineSchedulers/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = CombineSchedulers/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulers; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2A6F2AE624817B1F00ED215A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"CombineSchedulers/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = CombineSchedulers/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulers; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 2A6F2AE824817B1F00ED215A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = CombineSchedulersTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulersTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CombineSchedulers.app/CombineSchedulers"; + }; + name = Debug; + }; + 2A6F2AE924817B1F00ED215A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = CombineSchedulersTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulersTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CombineSchedulers.app/CombineSchedulers"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2A6F2AC024817B1E00ED215A /* Build configuration list for PBXProject "CombineSchedulers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A6F2AE224817B1F00ED215A /* Debug */, + 2A6F2AE324817B1F00ED215A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2A6F2AE424817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A6F2AE524817B1F00ED215A /* Debug */, + 2A6F2AE624817B1F00ED215A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2A6F2AE724817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulersTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A6F2AE824817B1F00ED215A /* Debug */, + 2A6F2AE924817B1F00ED215A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2A6F2ABD24817B1E00ED215A /* Project object */; +} diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..8ff61140 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/AppDelegate.swift b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/AppDelegate.swift new file mode 100644 index 00000000..72ab3aa0 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// CombineSchedulers +// +// Created by Point-Free on 5/29/20. +// Copyright © 2020 Point-Free. 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/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Assets.xcassets/AppIcon.appiconset/Contents.json b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Assets.xcassets/Contents.json b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Base.lproj/LaunchScreen.storyboard b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/ContentView.swift b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/ContentView.swift new file mode 100644 index 00000000..eae27d6e --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/ContentView.swift @@ -0,0 +1,91 @@ +import Combine +import SwiftUI + +func validationMessage( + forPassword password: P +) -> AnyPublisher where P.Output == String, P.Failure == Never { + + password.map { + $0.count < 5 ? "Password is too short 👎" + : $0.count > 20 ? "Password is too long 👎" + : "Password is good 👍" + } + .eraseToAnyPublisher() + +} + + +class RegisterViewModel: ObservableObject { + @Published var email = "" + @Published var password = "" + @Published var isLoginSuccessful = false + @Published var passwordValidationMessage = "" + + var cancellables: Set = [] + + let login: (String, String) -> AnyPublisher + + init( + login: @escaping (String, String) -> AnyPublisher + ) { + self.login = login + + self.$password + .map { + $0.count < 5 ? "Password is too short 👎" + : $0.count > 20 ? "Password is too long 👎" + : "Password is good 👍" + } + .sink { self.passwordValidationMessage = $0 } + .store(in: &self.cancellables) + } + + func loginButtonTapped() { + self.login(self.email, self.password) + .receive(on: DispatchQueue.main) + .sink { self.isLoginSuccessful = $0 } + .store(in: &self.cancellables) + } +} + + + +//class PasswordViewModel: ObservableObject { +// @Published var password: String = "" +// +// //let passwordValidationMessage: AnyPublisher +// @Published var passwordValidationMessage = "" +// +// func validatePassword() { +// validationMessage(forPassword: Just(self.password)) +// .sink { self.passwordValidationMessage = $0 } +// } +//} + +struct ContentView: View { +// @State var password: String = "" + @ObservedObject var viewModel = RegisterViewModel( + login: { _, _ in Just(true).eraseToAnyPublisher() } + ) + + var body: some View { + Form { + if self.viewModel.isLoginSuccessful { + Text("Logged in! Welcome!") + } else { + TextField("Email", text: self.$viewModel.email) + TextField("Password", text: self.$viewModel.password) + + Text(self.viewModel.passwordValidationMessage) + + Button("Login") { self.viewModel.loginButtonTapped() } + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Info.plist b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Info.plist new file mode 100644 index 00000000..9742bf0f --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/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/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Preview Content/Preview Assets.xcassets/Contents.json b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/SceneDelegate.swift b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/SceneDelegate.swift new file mode 100644 index 00000000..f9d5b4e2 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulers/SceneDelegate.swift @@ -0,0 +1,64 @@ +// +// SceneDelegate.swift +// CombineSchedulers +// +// Created by Point-Free on 5/29/20. +// Copyright © 2020 Point-Free. 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). + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView() + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + 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/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulersTests/CombineSchedulersTests.swift b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulersTests/CombineSchedulersTests.swift new file mode 100644 index 00000000..292f5719 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulersTests/CombineSchedulersTests.swift @@ -0,0 +1,27 @@ +import Combine +import XCTest +@testable import CombineSchedulers + +class CombineSchedulersTests: XCTestCase { + var cancellables: Set = [] + + func testHappyPath() { + let viewModel = RegisterViewModel( + login: { _, _ in Just(true).eraseToAnyPublisher() } + ) + + var expectedOutput: [Bool] = [] + viewModel.$isLoginSuccessful + .sink { expectedOutput.append($0) } + .store(in: &self.cancellables) + + XCTAssertEqual(expectedOutput, [false, ]) + viewModel.email = "blob@pointfree.co" + viewModel.password = "blob is awesome" + viewModel.loginButtonTapped() + _ = XCTWaiter.wait(for: [XCTestExpectation()], timeout: 0.01) + XCTAssertEqual(viewModel.isLoginSuccessful, true) + XCTAssertEqual(expectedOutput, [false, true]) + } + +} diff --git a/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulersTests/Info.plist b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulersTests/Info.plist new file mode 100644 index 00000000..64d65ca4 --- /dev/null +++ b/0104-combine-schedulers-pt1/CombineSchedulers/CombineSchedulersTests/Info.plist @@ -0,0 +1,22 @@ + + + + + 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 + + diff --git a/0104-combine-schedulers-pt1/README.md b/0104-combine-schedulers-pt1/README.md new file mode 100644 index 00000000..8a0f3bae --- /dev/null +++ b/0104-combine-schedulers-pt1/README.md @@ -0,0 +1,5 @@ +## [Point-Free](https://www.pointfree.co) + +> #### This directory contains code from Point-Free Episode: [Combine Schedulers: Testing Time](https://www.pointfree.co/episodes/ep104-combine-schedulers-testing-time) +> +> Combine is a powerful framework and is the de facto way to power SwiftUI applications, but how does one test reactive code? We will build a view model from scratch that involves asynchrony and time-based effects and explore what it takes to exhaustively test its functionality. diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.pbxproj b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.pbxproj new file mode 100644 index 00000000..92eaac09 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.pbxproj @@ -0,0 +1,474 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 2A6F2AC924817B1E00ED215A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2AC824817B1E00ED215A /* AppDelegate.swift */; }; + 2A6F2ACB24817B1E00ED215A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2ACA24817B1E00ED215A /* SceneDelegate.swift */; }; + 2A6F2ACD24817B1E00ED215A /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2ACC24817B1E00ED215A /* ContentView.swift */; }; + 2A6F2ACF24817B1F00ED215A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A6F2ACE24817B1F00ED215A /* Assets.xcassets */; }; + 2A6F2AD224817B1F00ED215A /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A6F2AD124817B1F00ED215A /* Preview Assets.xcassets */; }; + 2A6F2AD524817B1F00ED215A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A6F2AD324817B1F00ED215A /* LaunchScreen.storyboard */; }; + 2A6F2AE024817B1F00ED215A /* CombineSchedulersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6F2ADF24817B1F00ED215A /* CombineSchedulersTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 2A6F2ADC24817B1F00ED215A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2A6F2ABD24817B1E00ED215A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2A6F2AC424817B1E00ED215A; + remoteInfo = CombineSchedulers; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 2A6F2AC524817B1E00ED215A /* CombineSchedulers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CombineSchedulers.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A6F2AC824817B1E00ED215A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 2A6F2ACA24817B1E00ED215A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 2A6F2ACC24817B1E00ED215A /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 2A6F2ACE24817B1F00ED215A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 2A6F2AD124817B1F00ED215A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 2A6F2AD424817B1F00ED215A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 2A6F2AD624817B1F00ED215A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2A6F2ADB24817B1F00ED215A /* CombineSchedulersTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CombineSchedulersTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A6F2ADF24817B1F00ED215A /* CombineSchedulersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombineSchedulersTests.swift; sourceTree = ""; }; + 2A6F2AE124817B1F00ED215A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2A6F2AC224817B1E00ED215A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2A6F2AD824817B1F00ED215A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2A6F2ABC24817B1E00ED215A = { + isa = PBXGroup; + children = ( + 2A6F2AC724817B1E00ED215A /* CombineSchedulers */, + 2A6F2ADE24817B1F00ED215A /* CombineSchedulersTests */, + 2A6F2AC624817B1E00ED215A /* Products */, + ); + sourceTree = ""; + }; + 2A6F2AC624817B1E00ED215A /* Products */ = { + isa = PBXGroup; + children = ( + 2A6F2AC524817B1E00ED215A /* CombineSchedulers.app */, + 2A6F2ADB24817B1F00ED215A /* CombineSchedulersTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 2A6F2AC724817B1E00ED215A /* CombineSchedulers */ = { + isa = PBXGroup; + children = ( + 2A6F2AC824817B1E00ED215A /* AppDelegate.swift */, + 2A6F2ACA24817B1E00ED215A /* SceneDelegate.swift */, + 2A6F2ACC24817B1E00ED215A /* ContentView.swift */, + 2A6F2ACE24817B1F00ED215A /* Assets.xcassets */, + 2A6F2AD324817B1F00ED215A /* LaunchScreen.storyboard */, + 2A6F2AD624817B1F00ED215A /* Info.plist */, + 2A6F2AD024817B1F00ED215A /* Preview Content */, + ); + path = CombineSchedulers; + sourceTree = ""; + }; + 2A6F2AD024817B1F00ED215A /* Preview Content */ = { + isa = PBXGroup; + children = ( + 2A6F2AD124817B1F00ED215A /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 2A6F2ADE24817B1F00ED215A /* CombineSchedulersTests */ = { + isa = PBXGroup; + children = ( + 2A6F2ADF24817B1F00ED215A /* CombineSchedulersTests.swift */, + 2A6F2AE124817B1F00ED215A /* Info.plist */, + ); + path = CombineSchedulersTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2A6F2AC424817B1E00ED215A /* CombineSchedulers */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2A6F2AE424817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulers" */; + buildPhases = ( + 2A6F2AC124817B1E00ED215A /* Sources */, + 2A6F2AC224817B1E00ED215A /* Frameworks */, + 2A6F2AC324817B1E00ED215A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CombineSchedulers; + productName = CombineSchedulers; + productReference = 2A6F2AC524817B1E00ED215A /* CombineSchedulers.app */; + productType = "com.apple.product-type.application"; + }; + 2A6F2ADA24817B1F00ED215A /* CombineSchedulersTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2A6F2AE724817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulersTests" */; + buildPhases = ( + 2A6F2AD724817B1F00ED215A /* Sources */, + 2A6F2AD824817B1F00ED215A /* Frameworks */, + 2A6F2AD924817B1F00ED215A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 2A6F2ADD24817B1F00ED215A /* PBXTargetDependency */, + ); + name = CombineSchedulersTests; + productName = CombineSchedulersTests; + productReference = 2A6F2ADB24817B1F00ED215A /* CombineSchedulersTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2A6F2ABD24817B1E00ED215A /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1150; + LastUpgradeCheck = 1150; + ORGANIZATIONNAME = "Point-Free"; + TargetAttributes = { + 2A6F2AC424817B1E00ED215A = { + CreatedOnToolsVersion = 11.5; + }; + 2A6F2ADA24817B1F00ED215A = { + CreatedOnToolsVersion = 11.5; + TestTargetID = 2A6F2AC424817B1E00ED215A; + }; + }; + }; + buildConfigurationList = 2A6F2AC024817B1E00ED215A /* Build configuration list for PBXProject "CombineSchedulers" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 2A6F2ABC24817B1E00ED215A; + productRefGroup = 2A6F2AC624817B1E00ED215A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2A6F2AC424817B1E00ED215A /* CombineSchedulers */, + 2A6F2ADA24817B1F00ED215A /* CombineSchedulersTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2A6F2AC324817B1E00ED215A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6F2AD524817B1F00ED215A /* LaunchScreen.storyboard in Resources */, + 2A6F2AD224817B1F00ED215A /* Preview Assets.xcassets in Resources */, + 2A6F2ACF24817B1F00ED215A /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2A6F2AD924817B1F00ED215A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2A6F2AC124817B1E00ED215A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6F2AC924817B1E00ED215A /* AppDelegate.swift in Sources */, + 2A6F2ACB24817B1E00ED215A /* SceneDelegate.swift in Sources */, + 2A6F2ACD24817B1E00ED215A /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2A6F2AD724817B1F00ED215A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A6F2AE024817B1F00ED215A /* CombineSchedulersTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 2A6F2ADD24817B1F00ED215A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2A6F2AC424817B1E00ED215A /* CombineSchedulers */; + targetProxy = 2A6F2ADC24817B1F00ED215A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 2A6F2AD324817B1F00ED215A /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 2A6F2AD424817B1F00ED215A /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 2A6F2AE224817B1F00ED215A /* 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.5; + 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; + }; + 2A6F2AE324817B1F00ED215A /* 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.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 2A6F2AE524817B1F00ED215A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"CombineSchedulers/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = CombineSchedulers/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulers; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2A6F2AE624817B1F00ED215A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"CombineSchedulers/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = CombineSchedulers/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulers; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 2A6F2AE824817B1F00ED215A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = CombineSchedulersTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulersTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CombineSchedulers.app/CombineSchedulers"; + }; + name = Debug; + }; + 2A6F2AE924817B1F00ED215A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = CombineSchedulersTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.pointfree.CombineSchedulersTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CombineSchedulers.app/CombineSchedulers"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2A6F2AC024817B1E00ED215A /* Build configuration list for PBXProject "CombineSchedulers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A6F2AE224817B1F00ED215A /* Debug */, + 2A6F2AE324817B1F00ED215A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2A6F2AE424817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A6F2AE524817B1F00ED215A /* Debug */, + 2A6F2AE624817B1F00ED215A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2A6F2AE724817B1F00ED215A /* Build configuration list for PBXNativeTarget "CombineSchedulersTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A6F2AE824817B1F00ED215A /* Debug */, + 2A6F2AE924817B1F00ED215A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2A6F2ABD24817B1E00ED215A /* Project object */; +} diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..8ff61140 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/AppDelegate.swift b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/AppDelegate.swift new file mode 100644 index 00000000..72ab3aa0 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// CombineSchedulers +// +// Created by Point-Free on 5/29/20. +// Copyright © 2020 Point-Free. 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/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Assets.xcassets/AppIcon.appiconset/Contents.json b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Assets.xcassets/Contents.json b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Base.lproj/LaunchScreen.storyboard b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/ContentView.swift b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/ContentView.swift new file mode 100644 index 00000000..eae27d6e --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/ContentView.swift @@ -0,0 +1,91 @@ +import Combine +import SwiftUI + +func validationMessage( + forPassword password: P +) -> AnyPublisher where P.Output == String, P.Failure == Never { + + password.map { + $0.count < 5 ? "Password is too short 👎" + : $0.count > 20 ? "Password is too long 👎" + : "Password is good 👍" + } + .eraseToAnyPublisher() + +} + + +class RegisterViewModel: ObservableObject { + @Published var email = "" + @Published var password = "" + @Published var isLoginSuccessful = false + @Published var passwordValidationMessage = "" + + var cancellables: Set = [] + + let login: (String, String) -> AnyPublisher + + init( + login: @escaping (String, String) -> AnyPublisher + ) { + self.login = login + + self.$password + .map { + $0.count < 5 ? "Password is too short 👎" + : $0.count > 20 ? "Password is too long 👎" + : "Password is good 👍" + } + .sink { self.passwordValidationMessage = $0 } + .store(in: &self.cancellables) + } + + func loginButtonTapped() { + self.login(self.email, self.password) + .receive(on: DispatchQueue.main) + .sink { self.isLoginSuccessful = $0 } + .store(in: &self.cancellables) + } +} + + + +//class PasswordViewModel: ObservableObject { +// @Published var password: String = "" +// +// //let passwordValidationMessage: AnyPublisher +// @Published var passwordValidationMessage = "" +// +// func validatePassword() { +// validationMessage(forPassword: Just(self.password)) +// .sink { self.passwordValidationMessage = $0 } +// } +//} + +struct ContentView: View { +// @State var password: String = "" + @ObservedObject var viewModel = RegisterViewModel( + login: { _, _ in Just(true).eraseToAnyPublisher() } + ) + + var body: some View { + Form { + if self.viewModel.isLoginSuccessful { + Text("Logged in! Welcome!") + } else { + TextField("Email", text: self.$viewModel.email) + TextField("Password", text: self.$viewModel.password) + + Text(self.viewModel.passwordValidationMessage) + + Button("Login") { self.viewModel.loginButtonTapped() } + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Info.plist b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Info.plist new file mode 100644 index 00000000..9742bf0f --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/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/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Preview Content/Preview Assets.xcassets/Contents.json b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/SceneDelegate.swift b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/SceneDelegate.swift new file mode 100644 index 00000000..f9d5b4e2 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulers/SceneDelegate.swift @@ -0,0 +1,64 @@ +// +// SceneDelegate.swift +// CombineSchedulers +// +// Created by Point-Free on 5/29/20. +// Copyright © 2020 Point-Free. 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). + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView() + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + 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/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulersTests/CombineSchedulersTests.swift b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulersTests/CombineSchedulersTests.swift new file mode 100644 index 00000000..292f5719 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulersTests/CombineSchedulersTests.swift @@ -0,0 +1,27 @@ +import Combine +import XCTest +@testable import CombineSchedulers + +class CombineSchedulersTests: XCTestCase { + var cancellables: Set = [] + + func testHappyPath() { + let viewModel = RegisterViewModel( + login: { _, _ in Just(true).eraseToAnyPublisher() } + ) + + var expectedOutput: [Bool] = [] + viewModel.$isLoginSuccessful + .sink { expectedOutput.append($0) } + .store(in: &self.cancellables) + + XCTAssertEqual(expectedOutput, [false, ]) + viewModel.email = "blob@pointfree.co" + viewModel.password = "blob is awesome" + viewModel.loginButtonTapped() + _ = XCTWaiter.wait(for: [XCTestExpectation()], timeout: 0.01) + XCTAssertEqual(viewModel.isLoginSuccessful, true) + XCTAssertEqual(expectedOutput, [false, true]) + } + +} diff --git a/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulersTests/Info.plist b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulersTests/Info.plist new file mode 100644 index 00000000..64d65ca4 --- /dev/null +++ b/0105-combine-schedulers-pt2/CombineSchedulers/CombineSchedulersTests/Info.plist @@ -0,0 +1,22 @@ + + + + + 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 + + diff --git a/0105-combine-schedulers-pt2/README.md b/0105-combine-schedulers-pt2/README.md new file mode 100644 index 00000000..73841c27 --- /dev/null +++ b/0105-combine-schedulers-pt2/README.md @@ -0,0 +1,5 @@ +## [Point-Free](https://www.pointfree.co) + +> #### This directory contains code from Point-Free Episode: [Combine Schedulers: Controlling Time](https://www.pointfree.co/episodes/ep105-combine-schedulers-controlling-time) +> +> The `Scheduler` protocol of Combine is a powerful abstraction that unifies many ways of executing asynchronous work, and it can even control the flow of time through our code. Unfortunately Combine doesn't give us this ability out of the box, so let's build it from scratch. diff --git a/README.md b/README.md index b3b53f67..cac8b001 100644 --- a/README.md +++ b/README.md @@ -106,3 +106,5 @@ This repository is the home of code written on episodes of 1. [A Tour of the Composable Architecture: Part 2](0101-swift-composable-architecture-tour-pt2) 1. [A Tour of the Composable Architecture: Part 3](0102-swift-composable-architecture-tour-pt3) 1. [A Tour of the Composable Architecture: Part 4](0103-swift-composable-architecture-tour-pt4) +1. [Combine Schedulers: Testing Time](0104-combine-schedulers-pt1) +1. [Combine Schedulers: Controlling Time](0105-combine-schedulers-pt2)