diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..309d5aa Binary files /dev/null and b/.DS_Store differ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/README.md b/README.md new file mode 100644 index 0000000..3538894 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# i2020_03_14_Coordinator + +This repository is directly based on Paul Hudson and Soroush Khanlou + +See: +https://www.hackingwithswift.com/articles/71/how-to-use-the-coordinator-pattern-in-ios-apps +Paul Hudson + +and + +khanlou.com +Soroush Khanlou’s blog + + + diff --git a/i2020_03_14_Coordinator.xcodeproj/project.pbxproj b/i2020_03_14_Coordinator.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b5b2692 --- /dev/null +++ b/i2020_03_14_Coordinator.xcodeproj/project.pbxproj @@ -0,0 +1,635 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 8DFC7D83241D9A4600C5E59F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7D82241D9A4600C5E59F /* AppDelegate.swift */; }; + 8DFC7D85241D9A4600C5E59F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7D84241D9A4600C5E59F /* SceneDelegate.swift */; }; + 8DFC7D87241D9A4600C5E59F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7D86241D9A4600C5E59F /* ViewController.swift */; }; + 8DFC7D8A241D9A4600C5E59F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFC7D88241D9A4600C5E59F /* Main.storyboard */; }; + 8DFC7D8C241D9A4700C5E59F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DFC7D8B241D9A4700C5E59F /* Assets.xcassets */; }; + 8DFC7D8F241D9A4700C5E59F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DFC7D8D241D9A4700C5E59F /* LaunchScreen.storyboard */; }; + 8DFC7D9A241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7D99241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.swift */; }; + 8DFC7DA5241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7DA4241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.swift */; }; + 8DFC7DB4241D9F8100C5E59F /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7DB3241D9F8100C5E59F /* Coordinator.swift */; }; + 8DFC7DB6241D9FAA00C5E59F /* Storyboarded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7DB5241D9FAA00C5E59F /* Storyboarded.swift */; }; + 8DFC7DB9241D9FEB00C5E59F /* MainCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7DB8241D9FEB00C5E59F /* MainCoordinator.swift */; }; + 8DFC7DBB241DA0B600C5E59F /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7DBA241DA0B600C5E59F /* SecondViewController.swift */; }; + 8DFC7DBD241DA0C400C5E59F /* ThirdViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DFC7DBC241DA0C400C5E59F /* ThirdViewController.swift */; }; + B980A701243BAA730063B80F /* FourthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B980A700243BAA730063B80F /* FourthViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8DFC7D96241D9A4700C5E59F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8DFC7D77241D9A4600C5E59F /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8DFC7D7E241D9A4600C5E59F; + remoteInfo = i2020_03_14_Coordinator; + }; + 8DFC7DA1241D9A4800C5E59F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8DFC7D77241D9A4600C5E59F /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8DFC7D7E241D9A4600C5E59F; + remoteInfo = i2020_03_14_Coordinator; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8DFC7D7F241D9A4600C5E59F /* i2020_03_14_Coordinator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = i2020_03_14_Coordinator.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DFC7D82241D9A4600C5E59F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 8DFC7D84241D9A4600C5E59F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 8DFC7D86241D9A4600C5E59F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 8DFC7D89241D9A4600C5E59F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8DFC7D8B241D9A4700C5E59F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8DFC7D8E241D9A4700C5E59F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 8DFC7D90241D9A4700C5E59F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8DFC7D95241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = i2020_03_14_CoordinatorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DFC7D99241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = i2020_03_14_CoordinatorTests.swift; sourceTree = ""; }; + 8DFC7D9B241D9A4700C5E59F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8DFC7DA0241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = i2020_03_14_CoordinatorUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 8DFC7DA4241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = i2020_03_14_CoordinatorUITests.swift; sourceTree = ""; }; + 8DFC7DA6241D9A4800C5E59F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8DFC7DB3241D9F8100C5E59F /* Coordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = ""; }; + 8DFC7DB5241D9FAA00C5E59F /* Storyboarded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storyboarded.swift; sourceTree = ""; }; + 8DFC7DB8241D9FEB00C5E59F /* MainCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainCoordinator.swift; sourceTree = ""; }; + 8DFC7DBA241DA0B600C5E59F /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; + 8DFC7DBC241DA0C400C5E59F /* ThirdViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdViewController.swift; sourceTree = ""; }; + B980A700243BAA730063B80F /* FourthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FourthViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DFC7D7C241D9A4600C5E59F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8DFC7D92241D9A4700C5E59F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8DFC7D9D241D9A4800C5E59F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8DFC7D76241D9A4600C5E59F = { + isa = PBXGroup; + children = ( + 8DFC7D81241D9A4600C5E59F /* i2020_03_14_Coordinator */, + 8DFC7D98241D9A4700C5E59F /* i2020_03_14_CoordinatorTests */, + 8DFC7DA3241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests */, + 8DFC7D80241D9A4600C5E59F /* Products */, + ); + sourceTree = ""; + }; + 8DFC7D80241D9A4600C5E59F /* Products */ = { + isa = PBXGroup; + children = ( + 8DFC7D7F241D9A4600C5E59F /* i2020_03_14_Coordinator.app */, + 8DFC7D95241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.xctest */, + 8DFC7DA0241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8DFC7D81241D9A4600C5E59F /* i2020_03_14_Coordinator */ = { + isa = PBXGroup; + children = ( + 8DFC7DB7241D9FC900C5E59F /* ViewControllers */, + 8DFC7DB2241D9F6B00C5E59F /* Coordinators */, + 8DFC7D82241D9A4600C5E59F /* AppDelegate.swift */, + 8DFC7D88241D9A4600C5E59F /* Main.storyboard */, + 8DFC7D84241D9A4600C5E59F /* SceneDelegate.swift */, + 8DFC7D8B241D9A4700C5E59F /* Assets.xcassets */, + 8DFC7D8D241D9A4700C5E59F /* LaunchScreen.storyboard */, + 8DFC7D90241D9A4700C5E59F /* Info.plist */, + ); + path = i2020_03_14_Coordinator; + sourceTree = ""; + }; + 8DFC7D98241D9A4700C5E59F /* i2020_03_14_CoordinatorTests */ = { + isa = PBXGroup; + children = ( + 8DFC7D99241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.swift */, + 8DFC7D9B241D9A4700C5E59F /* Info.plist */, + ); + path = i2020_03_14_CoordinatorTests; + sourceTree = ""; + }; + 8DFC7DA3241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests */ = { + isa = PBXGroup; + children = ( + 8DFC7DA4241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.swift */, + 8DFC7DA6241D9A4800C5E59F /* Info.plist */, + ); + path = i2020_03_14_CoordinatorUITests; + sourceTree = ""; + }; + 8DFC7DB2241D9F6B00C5E59F /* Coordinators */ = { + isa = PBXGroup; + children = ( + 8DFC7DB8241D9FEB00C5E59F /* MainCoordinator.swift */, + 8DFC7DB3241D9F8100C5E59F /* Coordinator.swift */, + 8DFC7DB5241D9FAA00C5E59F /* Storyboarded.swift */, + ); + path = Coordinators; + sourceTree = ""; + }; + 8DFC7DB7241D9FC900C5E59F /* ViewControllers */ = { + isa = PBXGroup; + children = ( + 8DFC7D86241D9A4600C5E59F /* ViewController.swift */, + 8DFC7DBA241DA0B600C5E59F /* SecondViewController.swift */, + 8DFC7DBC241DA0C400C5E59F /* ThirdViewController.swift */, + B980A700243BAA730063B80F /* FourthViewController.swift */, + ); + path = ViewControllers; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8DFC7D7E241D9A4600C5E59F /* i2020_03_14_Coordinator */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8DFC7DA9241D9A4800C5E59F /* Build configuration list for PBXNativeTarget "i2020_03_14_Coordinator" */; + buildPhases = ( + 8DFC7D7B241D9A4600C5E59F /* Sources */, + 8DFC7D7C241D9A4600C5E59F /* Frameworks */, + 8DFC7D7D241D9A4600C5E59F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = i2020_03_14_Coordinator; + productName = i2020_03_14_Coordinator; + productReference = 8DFC7D7F241D9A4600C5E59F /* i2020_03_14_Coordinator.app */; + productType = "com.apple.product-type.application"; + }; + 8DFC7D94241D9A4700C5E59F /* i2020_03_14_CoordinatorTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8DFC7DAC241D9A4800C5E59F /* Build configuration list for PBXNativeTarget "i2020_03_14_CoordinatorTests" */; + buildPhases = ( + 8DFC7D91241D9A4700C5E59F /* Sources */, + 8DFC7D92241D9A4700C5E59F /* Frameworks */, + 8DFC7D93241D9A4700C5E59F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8DFC7D97241D9A4700C5E59F /* PBXTargetDependency */, + ); + name = i2020_03_14_CoordinatorTests; + productName = i2020_03_14_CoordinatorTests; + productReference = 8DFC7D95241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 8DFC7D9F241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8DFC7DAF241D9A4800C5E59F /* Build configuration list for PBXNativeTarget "i2020_03_14_CoordinatorUITests" */; + buildPhases = ( + 8DFC7D9C241D9A4800C5E59F /* Sources */, + 8DFC7D9D241D9A4800C5E59F /* Frameworks */, + 8DFC7D9E241D9A4800C5E59F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8DFC7DA2241D9A4800C5E59F /* PBXTargetDependency */, + ); + name = i2020_03_14_CoordinatorUITests; + productName = i2020_03_14_CoordinatorUITests; + productReference = 8DFC7DA0241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8DFC7D77241D9A4600C5E59F /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1130; + LastUpgradeCheck = 1130; + ORGANIZATIONNAME = "Bradford, Phillip"; + TargetAttributes = { + 8DFC7D7E241D9A4600C5E59F = { + CreatedOnToolsVersion = 11.3.1; + }; + 8DFC7D94241D9A4700C5E59F = { + CreatedOnToolsVersion = 11.3.1; + TestTargetID = 8DFC7D7E241D9A4600C5E59F; + }; + 8DFC7D9F241D9A4800C5E59F = { + CreatedOnToolsVersion = 11.3.1; + TestTargetID = 8DFC7D7E241D9A4600C5E59F; + }; + }; + }; + buildConfigurationList = 8DFC7D7A241D9A4600C5E59F /* Build configuration list for PBXProject "i2020_03_14_Coordinator" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8DFC7D76241D9A4600C5E59F; + productRefGroup = 8DFC7D80241D9A4600C5E59F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8DFC7D7E241D9A4600C5E59F /* i2020_03_14_Coordinator */, + 8DFC7D94241D9A4700C5E59F /* i2020_03_14_CoordinatorTests */, + 8DFC7D9F241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8DFC7D7D241D9A4600C5E59F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DFC7D8F241D9A4700C5E59F /* LaunchScreen.storyboard in Resources */, + 8DFC7D8C241D9A4700C5E59F /* Assets.xcassets in Resources */, + 8DFC7D8A241D9A4600C5E59F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8DFC7D93241D9A4700C5E59F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8DFC7D9E241D9A4800C5E59F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DFC7D7B241D9A4600C5E59F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DFC7DB4241D9F8100C5E59F /* Coordinator.swift in Sources */, + 8DFC7DB9241D9FEB00C5E59F /* MainCoordinator.swift in Sources */, + 8DFC7D87241D9A4600C5E59F /* ViewController.swift in Sources */, + B980A701243BAA730063B80F /* FourthViewController.swift in Sources */, + 8DFC7DB6241D9FAA00C5E59F /* Storyboarded.swift in Sources */, + 8DFC7DBB241DA0B600C5E59F /* SecondViewController.swift in Sources */, + 8DFC7D83241D9A4600C5E59F /* AppDelegate.swift in Sources */, + 8DFC7DBD241DA0C400C5E59F /* ThirdViewController.swift in Sources */, + 8DFC7D85241D9A4600C5E59F /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8DFC7D91241D9A4700C5E59F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DFC7D9A241D9A4700C5E59F /* i2020_03_14_CoordinatorTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8DFC7D9C241D9A4800C5E59F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DFC7DA5241D9A4800C5E59F /* i2020_03_14_CoordinatorUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8DFC7D97241D9A4700C5E59F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8DFC7D7E241D9A4600C5E59F /* i2020_03_14_Coordinator */; + targetProxy = 8DFC7D96241D9A4700C5E59F /* PBXContainerItemProxy */; + }; + 8DFC7DA2241D9A4800C5E59F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8DFC7D7E241D9A4600C5E59F /* i2020_03_14_Coordinator */; + targetProxy = 8DFC7DA1241D9A4800C5E59F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8DFC7D88241D9A4600C5E59F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8DFC7D89241D9A4600C5E59F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8DFC7D8D241D9A4700C5E59F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8DFC7D8E241D9A4700C5E59F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8DFC7DA7241D9A4800C5E59F /* 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; + }; + 8DFC7DA8241D9A4800C5E59F /* 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; + }; + 8DFC7DAA241D9A4800C5E59F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9RYN4XN273; + INFOPLIST_FILE = i2020_03_14_Coordinator/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "PGB.i2020-03-14-Coordinator"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 8DFC7DAB241D9A4800C5E59F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9RYN4XN273; + INFOPLIST_FILE = i2020_03_14_Coordinator/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "PGB.i2020-03-14-Coordinator"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 8DFC7DAD241D9A4800C5E59F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9RYN4XN273; + INFOPLIST_FILE = i2020_03_14_CoordinatorTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "PGB.i2020-03-14-CoordinatorTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/i2020_03_14_Coordinator.app/i2020_03_14_Coordinator"; + }; + name = Debug; + }; + 8DFC7DAE241D9A4800C5E59F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9RYN4XN273; + INFOPLIST_FILE = i2020_03_14_CoordinatorTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "PGB.i2020-03-14-CoordinatorTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/i2020_03_14_Coordinator.app/i2020_03_14_Coordinator"; + }; + name = Release; + }; + 8DFC7DB0241D9A4800C5E59F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9RYN4XN273; + INFOPLIST_FILE = i2020_03_14_CoordinatorUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "PGB.i2020-03-14-CoordinatorUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = i2020_03_14_Coordinator; + }; + name = Debug; + }; + 8DFC7DB1241D9A4800C5E59F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9RYN4XN273; + INFOPLIST_FILE = i2020_03_14_CoordinatorUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "PGB.i2020-03-14-CoordinatorUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = i2020_03_14_Coordinator; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8DFC7D7A241D9A4600C5E59F /* Build configuration list for PBXProject "i2020_03_14_Coordinator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8DFC7DA7241D9A4800C5E59F /* Debug */, + 8DFC7DA8241D9A4800C5E59F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8DFC7DA9241D9A4800C5E59F /* Build configuration list for PBXNativeTarget "i2020_03_14_Coordinator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8DFC7DAA241D9A4800C5E59F /* Debug */, + 8DFC7DAB241D9A4800C5E59F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8DFC7DAC241D9A4800C5E59F /* Build configuration list for PBXNativeTarget "i2020_03_14_CoordinatorTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8DFC7DAD241D9A4800C5E59F /* Debug */, + 8DFC7DAE241D9A4800C5E59F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8DFC7DAF241D9A4800C5E59F /* Build configuration list for PBXNativeTarget "i2020_03_14_CoordinatorUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8DFC7DB0241D9A4800C5E59F /* Debug */, + 8DFC7DB1241D9A4800C5E59F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8DFC7D77241D9A4600C5E59F /* Project object */; +} diff --git a/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..254b519 --- /dev/null +++ b/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/xcuserdata/kenny.xcuserdatad/UserInterfaceState.xcuserstate b/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/xcuserdata/kenny.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..2e668dd Binary files /dev/null and b/i2020_03_14_Coordinator.xcodeproj/project.xcworkspace/xcuserdata/kenny.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/i2020_03_14_Coordinator.xcodeproj/xcuserdata/kenny.xcuserdatad/xcschemes/xcschememanagement.plist b/i2020_03_14_Coordinator.xcodeproj/xcuserdata/kenny.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..08b4421 --- /dev/null +++ b/i2020_03_14_Coordinator.xcodeproj/xcuserdata/kenny.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + i2020_03_14_Coordinator.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/i2020_03_14_Coordinator.xcodeproj/xcuserdata/pgb15001.xcuserdatad/xcschemes/xcschememanagement.plist b/i2020_03_14_Coordinator.xcodeproj/xcuserdata/pgb15001.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..08b4421 --- /dev/null +++ b/i2020_03_14_Coordinator.xcodeproj/xcuserdata/pgb15001.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + i2020_03_14_Coordinator.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/i2020_03_14_Coordinator/AppDelegate.swift b/i2020_03_14_Coordinator/AppDelegate.swift new file mode 100644 index 0000000..3a05dbe --- /dev/null +++ b/i2020_03_14_Coordinator/AppDelegate.swift @@ -0,0 +1,58 @@ +// +// AppDelegate.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var coordinator: MainCoordinator? + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // create the main navigation controller to be used for our app + /* + let navController = UINavigationController() + + // send that into our coordinator so that it can display view controllers + coordinator = MainCoordinator(navigationController: navController) + + // tell the coordinator to take over control + coordinator?.start() + + // create a basic UIWindow and activate it + window = UIWindow(frame: UIScreen.main.bounds) + window?.rootViewController = navController + window?.makeKeyAndVisible() + */ + + return true + } +/* + 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/i2020_03_14_Coordinator/Assets.xcassets/AppIcon.appiconset/Contents.json b/i2020_03_14_Coordinator/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/i2020_03_14_Coordinator/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/i2020_03_14_Coordinator/Assets.xcassets/Contents.json b/i2020_03_14_Coordinator/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/i2020_03_14_Coordinator/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/i2020_03_14_Coordinator/Base.lproj/LaunchScreen.storyboard b/i2020_03_14_Coordinator/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/i2020_03_14_Coordinator/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/i2020_03_14_Coordinator/Base.lproj/Main.storyboard b/i2020_03_14_Coordinator/Base.lproj/Main.storyboard new file mode 100644 index 0000000..7a8d68d --- /dev/null +++ b/i2020_03_14_Coordinator/Base.lproj/Main.storyboard @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/i2020_03_14_Coordinator/Coordinators/Coordinator.swift b/i2020_03_14_Coordinator/Coordinators/Coordinator.swift new file mode 100644 index 0000000..7570e6a --- /dev/null +++ b/i2020_03_14_Coordinator/Coordinators/Coordinator.swift @@ -0,0 +1,16 @@ +// +// Coordinator.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +protocol Coordinator { + var childCoordinators: [Coordinator] { get set } + var navigationController: UINavigationController { get set } + + func start() +} diff --git a/i2020_03_14_Coordinator/Coordinators/MainCoordinator.swift b/i2020_03_14_Coordinator/Coordinators/MainCoordinator.swift new file mode 100644 index 0000000..6a8eb2d --- /dev/null +++ b/i2020_03_14_Coordinator/Coordinators/MainCoordinator.swift @@ -0,0 +1,42 @@ +// +// MainCoordinator.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +class MainCoordinator: Coordinator { + var childCoordinators = [Coordinator]() + var navigationController: UINavigationController + + init(navigationController: UINavigationController) { + self.navigationController = navigationController + } + + func start() { + let vc = ViewController.instantiate() + vc.coordinator = self + navigationController.pushViewController(vc, animated: false) + } + + func buySubscription() { + let vc = SecondViewController.instantiate() + vc.coordinator = self + navigationController.pushViewController(vc, animated: true) + } + + func createAccount() { + let vc = ThirdViewController.instantiate() + vc.coordinator = self + navigationController.pushViewController(vc, animated: true) + } + + func cancelSubscription() { + let vc = FourthViewController.instantiate() + vc.coordinator = self + navigationController.pushViewController(vc, animated: true) + } +} diff --git a/i2020_03_14_Coordinator/Coordinators/Storyboarded.swift b/i2020_03_14_Coordinator/Coordinators/Storyboarded.swift new file mode 100644 index 0000000..479eac4 --- /dev/null +++ b/i2020_03_14_Coordinator/Coordinators/Storyboarded.swift @@ -0,0 +1,29 @@ +// +// Storyboarded.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +protocol Storyboarded { + static func instantiate() -> Self +} + +extension Storyboarded where Self: UIViewController { + static func instantiate() -> Self { + // this pulls out "MyApp.MyViewController" + let fullName = NSStringFromClass(self) + + // this splits by the dot and uses everything after, giving "MyViewController" + let className = fullName.components(separatedBy: ".")[1] + + // load our storyboard + let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main) + + // instantiate a view controller with that identifier, and force cast as the type that was requested + return storyboard.instantiateViewController(withIdentifier: className) as! Self + } +} diff --git a/i2020_03_14_Coordinator/Info.plist b/i2020_03_14_Coordinator/Info.plist new file mode 100644 index 0000000..9592629 --- /dev/null +++ b/i2020_03_14_Coordinator/Info.plist @@ -0,0 +1,62 @@ + + + + + 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 + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/i2020_03_14_Coordinator/SceneDelegate.swift b/i2020_03_14_Coordinator/SceneDelegate.swift new file mode 100644 index 0000000..eedb027 --- /dev/null +++ b/i2020_03_14_Coordinator/SceneDelegate.swift @@ -0,0 +1,68 @@ +// +// SceneDelegate.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var coordinator: MainCoordinator? + 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). + guard let windowScene = (scene as? UIWindowScene) else { return } + + // create the main navigation controller to be used for our app + let navController = UINavigationController() + + // send that into our coordinator so that it can display view controllers + coordinator = MainCoordinator(navigationController: navController) + + // tell the coordinator to take over control + coordinator?.start() + + window = UIWindow(frame: windowScene.coordinateSpace.bounds) + window?.windowScene = windowScene + window?.rootViewController = navController + + 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/i2020_03_14_Coordinator/ViewControllers/FourthViewController.swift b/i2020_03_14_Coordinator/ViewControllers/FourthViewController.swift new file mode 100644 index 0000000..1101cde --- /dev/null +++ b/i2020_03_14_Coordinator/ViewControllers/FourthViewController.swift @@ -0,0 +1,21 @@ +// +// FourthViewController.swift +// i2020_03_14_Coordinator +// +// Created by Kenny Payes on 4/6/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +class FourthViewController: UIViewController, Storyboarded { + + var coordinator: MainCoordinator? + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + +} diff --git a/i2020_03_14_Coordinator/ViewControllers/SecondViewController.swift b/i2020_03_14_Coordinator/ViewControllers/SecondViewController.swift new file mode 100644 index 0000000..c966b38 --- /dev/null +++ b/i2020_03_14_Coordinator/ViewControllers/SecondViewController.swift @@ -0,0 +1,20 @@ +// +// SecondViewController.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +class SecondViewController: UIViewController, Storyboarded { + + weak var coordinator: MainCoordinator? + + override func viewDidLoad() { + super.viewDidLoad() + + } + +} diff --git a/i2020_03_14_Coordinator/ViewControllers/ThirdViewController.swift b/i2020_03_14_Coordinator/ViewControllers/ThirdViewController.swift new file mode 100644 index 0000000..079209a --- /dev/null +++ b/i2020_03_14_Coordinator/ViewControllers/ThirdViewController.swift @@ -0,0 +1,22 @@ +// +// ThirdViewController.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +class ThirdViewController: UIViewController, Storyboarded { + + var coordinator: MainCoordinator? + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + +} diff --git a/i2020_03_14_Coordinator/ViewControllers/ViewController.swift b/i2020_03_14_Coordinator/ViewControllers/ViewController.swift new file mode 100644 index 0000000..2a3083a --- /dev/null +++ b/i2020_03_14_Coordinator/ViewControllers/ViewController.swift @@ -0,0 +1,32 @@ +// +// ViewController.swift +// i2020_03_14_Coordinator +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController, Storyboarded { + + weak var coordinator: MainCoordinator? + + override func viewDidLoad() { + super.viewDidLoad() + } + + @IBAction func second(_ sender: Any) { + coordinator?.buySubscription() + } + + @IBAction func third(_ sender: Any) { + coordinator?.createAccount() + } + + @IBAction func fourth(_ sender: Any) { + coordinator?.cancelSubscription() + } + +} + diff --git a/i2020_03_14_CoordinatorTests/Info.plist b/i2020_03_14_CoordinatorTests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/i2020_03_14_CoordinatorTests/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/i2020_03_14_CoordinatorTests/i2020_03_14_CoordinatorTests.swift b/i2020_03_14_CoordinatorTests/i2020_03_14_CoordinatorTests.swift new file mode 100644 index 0000000..e3801be --- /dev/null +++ b/i2020_03_14_CoordinatorTests/i2020_03_14_CoordinatorTests.swift @@ -0,0 +1,34 @@ +// +// i2020_03_14_CoordinatorTests.swift +// i2020_03_14_CoordinatorTests +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import XCTest +@testable import i2020_03_14_Coordinator + +class i2020_03_14_CoordinatorTests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/i2020_03_14_CoordinatorUITests/Info.plist b/i2020_03_14_CoordinatorUITests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/i2020_03_14_CoordinatorUITests/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/i2020_03_14_CoordinatorUITests/i2020_03_14_CoordinatorUITests.swift b/i2020_03_14_CoordinatorUITests/i2020_03_14_CoordinatorUITests.swift new file mode 100644 index 0000000..257a648 --- /dev/null +++ b/i2020_03_14_CoordinatorUITests/i2020_03_14_CoordinatorUITests.swift @@ -0,0 +1,43 @@ +// +// i2020_03_14_CoordinatorUITests.swift +// i2020_03_14_CoordinatorUITests +// +// Created by Bradford, Phillip on 3/14/20. +// Copyright © 2020 Bradford, Phillip. All rights reserved. +// + +import XCTest + +class i2020_03_14_CoordinatorUITests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testLaunchPerformance() { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { + XCUIApplication().launch() + } + } + } +}