From c647ee7074ccbfb2f7c8f1a9f8ef4d2cc27246f7 Mon Sep 17 00:00:00 2001 From: Soo Rin Park Date: Mon, 1 Nov 2021 09:17:44 -0600 Subject: [PATCH] Create a sample app for Combine backed worker --- Package.swift | 10 - Samples/WorkflowCombineSampleApp/Podfile | 9 + Samples/WorkflowCombineSampleApp/Podfile.lock | 58 +++ .../project.pbxproj | 408 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../AppDelegate.swift | 30 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../Base.lproj/Main.storyboard | 24 ++ .../DemoViewController.swift | 31 ++ .../WorkflowCombineSampleApp/DemoWorker.swift | 30 ++ .../DemoWorkflow.swift | 72 ++++ .../WorkflowCombineSampleApp/Info.plist | 66 +++ .../SceneDelegate.swift | 53 +++ .../ViewController.swift | 15 + WorkflowCombine.podspec | 2 +- 21 files changed, 970 insertions(+), 11 deletions(-) create mode 100644 Samples/WorkflowCombineSampleApp/Podfile create mode 100644 Samples/WorkflowCombineSampleApp/Podfile.lock create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.pbxproj create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/contents.xcworkspacedata create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/AppDelegate.swift create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/Contents.json create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/LaunchScreen.storyboard create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/Main.storyboard create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoViewController.swift create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorker.swift create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorkflow.swift create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Info.plist create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/SceneDelegate.swift create mode 100644 Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/ViewController.swift diff --git a/Package.swift b/Package.swift index 73615c6b9..21dd18027 100644 --- a/Package.swift +++ b/Package.swift @@ -71,16 +71,6 @@ let package = Package( dependencies: ["Workflow"], path: "WorkflowCombine/Sources" ), - .testTarget( - name: "WorkflowCombineTests", - dependencies: ["Workflow", "WorkflowCombine", "WorkflowTesting"], - path: "WorkflowCombine/Tests" - ), - .target( - name: "WorkflowTesting", - dependencies: ["Workflow"], - path: "WorkflowTesting/Sources" - ), ], swiftLanguageVersions: [.v5] ) diff --git a/Samples/WorkflowCombineSampleApp/Podfile b/Samples/WorkflowCombineSampleApp/Podfile new file mode 100644 index 000000000..775b9423d --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/Podfile @@ -0,0 +1,9 @@ +project 'WorkflowCombineSampleApp.xcodeproj' +platform :ios, '13.0' + +target 'WorkflowCombineSampleApp' do + pod 'Workflow', path: '../../Workflow.podspec', :testspecs => ['Tests'] + pod 'WorkflowUI', path: '../../WorkflowUI.podspec', :testspecs => ['Tests'] + pod 'WorkflowCombine', path: '../../WorkflowCombine.podspec' + pod 'WorkflowReactiveSwift', path: '../../WorkflowReactiveSwift.podspec', :testspecs => ['Tests'] +end \ No newline at end of file diff --git a/Samples/WorkflowCombineSampleApp/Podfile.lock b/Samples/WorkflowCombineSampleApp/Podfile.lock new file mode 100644 index 000000000..2307817a0 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/Podfile.lock @@ -0,0 +1,58 @@ +PODS: + - ReactiveSwift (6.3.0) + - Workflow (1.0.0-rc.1): + - ReactiveSwift (~> 6.3.0) + - Workflow/Tests (1.0.0-rc.1): + - ReactiveSwift (~> 6.3.0) + - WorkflowCombine (1.0.0-rc.1): + - Workflow (= 1.0.0-rc.1) + - WorkflowReactiveSwift (1.0.0-rc.1): + - ReactiveSwift (~> 6.3.0) + - Workflow (= 1.0.0-rc.1) + - WorkflowReactiveSwift/Tests (1.0.0-rc.1): + - ReactiveSwift (~> 6.3.0) + - Workflow (= 1.0.0-rc.1) + - WorkflowTesting (= 1.0.0-rc.1) + - WorkflowTesting (1.0.0-rc.1): + - Workflow (= 1.0.0-rc.1) + - WorkflowUI (1.0.0-rc.1): + - Workflow (= 1.0.0-rc.1) + - WorkflowUI/Tests (1.0.0-rc.1): + - Workflow (= 1.0.0-rc.1) + - WorkflowReactiveSwift (= 1.0.0-rc.1) + +DEPENDENCIES: + - Workflow (from `../../Workflow.podspec`) + - Workflow/Tests (from `../../Workflow.podspec`) + - WorkflowCombine (from `../../WorkflowCombine.podspec`) + - WorkflowReactiveSwift (from `../../WorkflowReactiveSwift.podspec`) + - WorkflowReactiveSwift/Tests (from `../../WorkflowReactiveSwift.podspec`) + - WorkflowUI (from `../../WorkflowUI.podspec`) + - WorkflowUI/Tests (from `../../WorkflowUI.podspec`) + +SPEC REPOS: + trunk: + - ReactiveSwift + - WorkflowTesting + +EXTERNAL SOURCES: + Workflow: + :path: "../../Workflow.podspec" + WorkflowCombine: + :path: "../../WorkflowCombine.podspec" + WorkflowReactiveSwift: + :path: "../../WorkflowReactiveSwift.podspec" + WorkflowUI: + :path: "../../WorkflowUI.podspec" + +SPEC CHECKSUMS: + ReactiveSwift: 7937f26ec18d555e2a99352bd0a8b2817d1f042d + Workflow: e3391755e611eb0e0efc244ef5fa9b12c6e2f8ab + WorkflowCombine: 8806745d6023261bfbc34e0d1da753774e9fe0c5 + WorkflowReactiveSwift: a1854c330a7ea4342e999156e0abe7f216e16d63 + WorkflowTesting: ff584e427bda8491285deb97db14182925d1e4f4 + WorkflowUI: 0e3b93590dc2e58a93f300a47e5c8e81b501ef36 + +PODFILE CHECKSUM: 59f19f06532469f70596f7954b3f8fe590c38ef1 + +COCOAPODS: 1.9.1 diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.pbxproj b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.pbxproj new file mode 100644 index 000000000..8ec1bb757 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.pbxproj @@ -0,0 +1,408 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 9A8259C8C723B39466D03271 /* libPods-WorkflowCombineSampleApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FB177673F3D3F7E40B2E3F52 /* libPods-WorkflowCombineSampleApp.a */; }; + F91FC5E1272B5EF000F19C3D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91FC5E0272B5EF000F19C3D /* AppDelegate.swift */; }; + F91FC5E3272B5EF000F19C3D /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91FC5E2272B5EF000F19C3D /* SceneDelegate.swift */; }; + F91FC5E5272B5EF000F19C3D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91FC5E4272B5EF000F19C3D /* ViewController.swift */; }; + F91FC5E8272B5EF000F19C3D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F91FC5E6272B5EF000F19C3D /* Main.storyboard */; }; + F91FC5EA272B5EF700F19C3D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F91FC5E9272B5EF700F19C3D /* Assets.xcassets */; }; + F91FC5ED272B5EF700F19C3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F91FC5EB272B5EF700F19C3D /* LaunchScreen.storyboard */; }; + F91FC5F6272B5F0500F19C3D /* DemoWorkflow.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91FC5F4272B5F0500F19C3D /* DemoWorkflow.swift */; }; + F91FC5F7272B5F0500F19C3D /* DemoWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91FC5F5272B5F0500F19C3D /* DemoWorker.swift */; }; + F91FC5F9272B5FBB00F19C3D /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91FC5F8272B5FBB00F19C3D /* DemoViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 9CD0CAA819EECAD20D89C730 /* Pods-WorkflowCombineSampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WorkflowCombineSampleApp.debug.xcconfig"; path = "Target Support Files/Pods-WorkflowCombineSampleApp/Pods-WorkflowCombineSampleApp.debug.xcconfig"; sourceTree = ""; }; + DCBB19D1BA1D3E7BDFA35AAC /* Pods-WorkflowCombineSampleApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WorkflowCombineSampleApp.release.xcconfig"; path = "Target Support Files/Pods-WorkflowCombineSampleApp/Pods-WorkflowCombineSampleApp.release.xcconfig"; sourceTree = ""; }; + F91FC5DD272B5EF000F19C3D /* WorkflowCombineSampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WorkflowCombineSampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F91FC5E0272B5EF000F19C3D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + F91FC5E2272B5EF000F19C3D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + F91FC5E4272B5EF000F19C3D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + F91FC5E7272B5EF000F19C3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + F91FC5E9272B5EF700F19C3D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F91FC5EC272B5EF700F19C3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + F91FC5EE272B5EF700F19C3D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F91FC5F4272B5F0500F19C3D /* DemoWorkflow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoWorkflow.swift; sourceTree = ""; }; + F91FC5F5272B5F0500F19C3D /* DemoWorker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoWorker.swift; sourceTree = ""; }; + F91FC5F8272B5FBB00F19C3D /* DemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = ""; }; + FB177673F3D3F7E40B2E3F52 /* libPods-WorkflowCombineSampleApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WorkflowCombineSampleApp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F91FC5DA272B5EF000F19C3D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9A8259C8C723B39466D03271 /* libPods-WorkflowCombineSampleApp.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2301A5C693F40633B788F033 /* Frameworks */ = { + isa = PBXGroup; + children = ( + FB177673F3D3F7E40B2E3F52 /* libPods-WorkflowCombineSampleApp.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 5B949144518AC7D6FECAFCBF /* Pods */ = { + isa = PBXGroup; + children = ( + 9CD0CAA819EECAD20D89C730 /* Pods-WorkflowCombineSampleApp.debug.xcconfig */, + DCBB19D1BA1D3E7BDFA35AAC /* Pods-WorkflowCombineSampleApp.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + F91FC5D4272B5EF000F19C3D = { + isa = PBXGroup; + children = ( + F91FC5DF272B5EF000F19C3D /* WorkflowCombineSampleApp */, + F91FC5DE272B5EF000F19C3D /* Products */, + 5B949144518AC7D6FECAFCBF /* Pods */, + 2301A5C693F40633B788F033 /* Frameworks */, + ); + sourceTree = ""; + }; + F91FC5DE272B5EF000F19C3D /* Products */ = { + isa = PBXGroup; + children = ( + F91FC5DD272B5EF000F19C3D /* WorkflowCombineSampleApp.app */, + ); + name = Products; + sourceTree = ""; + }; + F91FC5DF272B5EF000F19C3D /* WorkflowCombineSampleApp */ = { + isa = PBXGroup; + children = ( + F91FC5F5272B5F0500F19C3D /* DemoWorker.swift */, + F91FC5F4272B5F0500F19C3D /* DemoWorkflow.swift */, + F91FC5E0272B5EF000F19C3D /* AppDelegate.swift */, + F91FC5E2272B5EF000F19C3D /* SceneDelegate.swift */, + F91FC5F8272B5FBB00F19C3D /* DemoViewController.swift */, + F91FC5E4272B5EF000F19C3D /* ViewController.swift */, + F91FC5E6272B5EF000F19C3D /* Main.storyboard */, + F91FC5E9272B5EF700F19C3D /* Assets.xcassets */, + F91FC5EB272B5EF700F19C3D /* LaunchScreen.storyboard */, + F91FC5EE272B5EF700F19C3D /* Info.plist */, + ); + path = WorkflowCombineSampleApp; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F91FC5DC272B5EF000F19C3D /* WorkflowCombineSampleApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = F91FC5F1272B5EF700F19C3D /* Build configuration list for PBXNativeTarget "WorkflowCombineSampleApp" */; + buildPhases = ( + BC8BD4A8482F12EE585D17CE /* [CP] Check Pods Manifest.lock */, + F91FC5D9272B5EF000F19C3D /* Sources */, + F91FC5DA272B5EF000F19C3D /* Frameworks */, + F91FC5DB272B5EF000F19C3D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WorkflowCombineSampleApp; + productName = WorkflowCombineSampleApp; + productReference = F91FC5DD272B5EF000F19C3D /* WorkflowCombineSampleApp.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F91FC5D5272B5EF000F19C3D /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1250; + LastUpgradeCheck = 1250; + TargetAttributes = { + F91FC5DC272B5EF000F19C3D = { + CreatedOnToolsVersion = 12.5.1; + }; + }; + }; + buildConfigurationList = F91FC5D8272B5EF000F19C3D /* Build configuration list for PBXProject "WorkflowCombineSampleApp" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F91FC5D4272B5EF000F19C3D; + productRefGroup = F91FC5DE272B5EF000F19C3D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F91FC5DC272B5EF000F19C3D /* WorkflowCombineSampleApp */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F91FC5DB272B5EF000F19C3D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F91FC5ED272B5EF700F19C3D /* LaunchScreen.storyboard in Resources */, + F91FC5EA272B5EF700F19C3D /* Assets.xcassets in Resources */, + F91FC5E8272B5EF000F19C3D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + BC8BD4A8482F12EE585D17CE /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-WorkflowCombineSampleApp-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F91FC5D9272B5EF000F19C3D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F91FC5E5272B5EF000F19C3D /* ViewController.swift in Sources */, + F91FC5F7272B5F0500F19C3D /* DemoWorker.swift in Sources */, + F91FC5F6272B5F0500F19C3D /* DemoWorkflow.swift in Sources */, + F91FC5F9272B5FBB00F19C3D /* DemoViewController.swift in Sources */, + F91FC5E1272B5EF000F19C3D /* AppDelegate.swift in Sources */, + F91FC5E3272B5EF000F19C3D /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + F91FC5E6272B5EF000F19C3D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F91FC5E7272B5EF000F19C3D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + F91FC5EB272B5EF700F19C3D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F91FC5EC272B5EF700F19C3D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F91FC5EF272B5EF700F19C3D /* 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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 = 14.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; + }; + F91FC5F0272B5EF700F19C3D /* 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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 = 14.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; + }; + F91FC5F2272B5EF700F19C3D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9CD0CAA819EECAD20D89C730 /* Pods-WorkflowCombineSampleApp.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = WorkflowCombineSampleApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.soorinpark.parkornapp.WorkflowCombineSampleApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F91FC5F3272B5EF700F19C3D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DCBB19D1BA1D3E7BDFA35AAC /* Pods-WorkflowCombineSampleApp.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = WorkflowCombineSampleApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.soorinpark.parkornapp.WorkflowCombineSampleApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F91FC5D8272B5EF000F19C3D /* Build configuration list for PBXProject "WorkflowCombineSampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F91FC5EF272B5EF700F19C3D /* Debug */, + F91FC5F0272B5EF700F19C3D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F91FC5F1272B5EF700F19C3D /* Build configuration list for PBXNativeTarget "WorkflowCombineSampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F91FC5F2272B5EF700F19C3D /* Debug */, + F91FC5F3272B5EF700F19C3D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F91FC5D5272B5EF000F19C3D /* Project object */; +} diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/contents.xcworkspacedata b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..c8c598923 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/AppDelegate.swift b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/AppDelegate.swift new file mode 100644 index 000000000..ec87c1c79 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/AppDelegate.swift @@ -0,0 +1,30 @@ +// +// AppDelegate.swift +// WorkflowCombineSampleApp +// +// Created by Soo Rin Park on 10/28/21. +// + +import UIKit + +@main +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/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..9221b9bb1 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/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/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/Contents.json b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/LaunchScreen.storyboard b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/Main.storyboard b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/Main.storyboard new file mode 100644 index 000000000..25a763858 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoViewController.swift b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoViewController.swift new file mode 100644 index 000000000..1927c7c5d --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoViewController.swift @@ -0,0 +1,31 @@ +// +// DemoViewController.swift +// WorkflowCombineSampleApp +// +// Created by Soo Rin Park on 10/28/21. +// + +import Foundation +import UIKit +import WorkflowUI + +class DemoViewController: ScreenViewController { + private let label = UILabel() + + override func viewDidLoad() { + super.viewDidLoad() + + label.translatesAutoresizingMaskIntoConstraints = false + view.addSubview(label) + label.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + label.topAnchor.constraint(equalTo: view.topAnchor).isActive = true + label.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + label.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true + } + + override func screenDidChange(from previousScreen: DemoScreen, previousEnvironment: ViewEnvironment) { + super.screenDidChange(from: previousScreen, previousEnvironment: previousEnvironment) + + label.text = screen.date + } +} diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorker.swift b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorker.swift new file mode 100644 index 000000000..10f69fa06 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorker.swift @@ -0,0 +1,30 @@ +// +// DemoWorker.swift +// WorkflowCombineSampleApp +// +// Created by Soo Rin Park on 10/28/21. +// + +import Combine +import Workflow +import WorkflowCombine +import WorkflowUI + +// MARK: Workers + +extension DemoWorkflow { + struct DemoWorker: Worker { + typealias Output = Action + + // This publisher publishes the current date on a timer that fires every second + func run() -> AnyPublisher { + Timer.publish(every: 1, on: .main, in: .common) + .autoconnect() + .replaceError(with: Date()) + .map { .init(publishedDate: $0) } + .eraseToAnyPublisher() + } + + func isEquivalent(to otherWorker: DemoWorkflow.DemoWorker) -> Bool { true } + } +} diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorkflow.swift b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorkflow.swift new file mode 100644 index 000000000..81dbd97e4 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/DemoWorkflow.swift @@ -0,0 +1,72 @@ +// +// DemoWorkflow.swift +// WorkflowCombineSampleApp +// +// Created by Soo Rin Park on 10/28/21. +// + +import Combine +import Workflow +import WorkflowUI + +// MARK: Input and Output + +let dateFormatter = DateFormatter() + +struct DemoWorkflow: Workflow { + typealias Output = Never +} + +// MARK: State and Initialization + +extension DemoWorkflow { + struct State { + var date: Date + } + + func makeInitialState() -> DemoWorkflow.State { State(date: Date()) } + + func workflowDidChange(from previousWorkflow: DemoWorkflow, state: inout State) {} +} + +// MARK: Actions + +extension DemoWorkflow { + struct Action: WorkflowAction { + typealias WorkflowType = DemoWorkflow + + let publishedDate: Date + + func apply(toState state: inout DemoWorkflow.State) -> DemoWorkflow.Output? { + state.date = publishedDate + return nil + } + } +} + +// MARK: Rendering + +extension DemoWorkflow { + // TODO: Change this to your actual rendering type + typealias Rendering = DemoScreen + + func render(state: DemoWorkflow.State, context: RenderContext) -> Rendering { + DemoWorker() + .rendered(in: context) + + dateFormatter.dateStyle = .long + dateFormatter.timeStyle = .long + let formattedDate = dateFormatter.string(from: state.date) + let rendering = Rendering(date: formattedDate) + + return rendering + } +} + +struct DemoScreen: Screen { + let date: String + + func viewControllerDescription(environment: ViewEnvironment) -> ViewControllerDescription { + DemoViewController.description(for: self, environment: environment) + } +} diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Info.plist b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Info.plist new file mode 100644 index 000000000..5b531f7b2 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/Info.plist @@ -0,0 +1,66 @@ + + + + + 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 + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/SceneDelegate.swift b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/SceneDelegate.swift new file mode 100644 index 000000000..135e6cf16 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/SceneDelegate.swift @@ -0,0 +1,53 @@ +// +// SceneDelegate.swift +// WorkflowCombineSampleApp +// +// Created by Soo Rin Park on 10/28/21. +// + +import UIKit +import WorkflowUI + +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). + guard let windowScene = (scene as? UIWindowScene) else { return } + let window = UIWindow(windowScene: windowScene) + let viewController = ContainerViewController(workflow: DemoWorkflow()) + window.rootViewController = viewController + 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 necessarily 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/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/ViewController.swift b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/ViewController.swift new file mode 100644 index 000000000..f582053e8 --- /dev/null +++ b/Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/ViewController.swift @@ -0,0 +1,15 @@ +// +// ViewController.swift +// WorkflowCombineSampleApp +// +// Created by Soo Rin Park on 10/28/21. +// + +import UIKit + +class ViewController: UIViewController { + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } +} diff --git a/WorkflowCombine.podspec b/WorkflowCombine.podspec index 7ee44c369..0c6e61232 100644 --- a/WorkflowCombine.podspec +++ b/WorkflowCombine.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.15' s.source_files = 'WorkflowCombine/Sources/*.swift' - + s.dependency 'Workflow', "#{s.version}" end