diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c4aa699 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +on: push +env: + DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer + +jobs: + uikit-only-tests: + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v2 + # I wanted to use xcbeautify to make the logs cleaner, but it fails to + # install (1) because macos-11, at the time of writing, has Xcode 11 as + # the default and the tool requires 12.1 (2) + # + # As you can see above, I set the DEVELOPER_DIR environment variable, but + # it doesn't seem to work for this step (3). + # + # References: + # 1. https://github.com/actions/virtual-environments/blob/a31ef3fcfe1eebb2fc8e557b76d85315d5651991/images/macos/macos-11.0-Readme.md + # 2. https://github.com/mokacoding/TestAppDelegateExample/runs/1383211558?check_suite_focus=true#step:3:18 + # 3. https://github.com/mokacoding/TestAppDelegateExample/runs/1383279298?check_suite_focus=true#step:3:20 + # + # - run: | + # brew tap thii/xcbeautify https://github.com/thii/xcbeautify.git + # brew install xcbeautify + - name: UIKit Example Tests + run: | + cd UIKit-Example + xcodebuild test \ + -project TestAppDelegateExample.xcodeproj \ + -scheme TestAppDelegateExample \ + -destination 'platform=iOS Simulator,name=iPhone 12 Pro' -sdk iphonesimulator # | xcbeautify + + swiftui-only-tests: + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v2 + # - run: | + # brew tap thii/xcbeautify https://github.com/thii/xcbeautify.git + # brew install xcbeautify + - name: SwiftUI Example Tests + run: | + cd SwiftUI-Example + xcodebuild test \ + -project TestAppExample.xcodeproj \ + -scheme TestAppExample \ + -destination 'platform=iOS Simulator,name=iPhone 12 Pro' -sdk iphonesimulator # | xcbeautify + + + swiftui-wit-uikit-only-tests: + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v2 + # - run: | + # brew tap thii/xcbeautify https://github.com/thii/xcbeautify.git + # brew install xcbeautify + - name: Mixed SwiftUI and UIKit Example Tests + run: | + cd Mixed-SwiftUI-UIKit-Example + xcodebuild test \ + -project MixedSwiftUIUIKitExample.xcodeproj \ + -scheme MixedSwiftUIUIKitExample \ + -destination 'platform=iOS Simulator,name=iPhone 12 Pro' -sdk iphonesimulator # | xcbeautify diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.pbxproj b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f833ea6 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.pbxproj @@ -0,0 +1,604 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 3F52E427255B816600091058 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E426255B816600091058 /* AppDelegate.swift */; }; + 3F52E429255B816600091058 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E428255B816600091058 /* SceneDelegate.swift */; }; + 3F52E42B255B816600091058 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E42A255B816600091058 /* ContentView.swift */; }; + 3F52E42D255B816700091058 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F52E42C255B816700091058 /* Assets.xcassets */; }; + 3F52E430255B816700091058 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F52E42F255B816700091058 /* Preview Assets.xcassets */; }; + 3F52E433255B816700091058 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3F52E431255B816700091058 /* LaunchScreen.storyboard */; }; + 3F52E43E255B816800091058 /* MixedSwiftUIUIKitExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E43D255B816800091058 /* MixedSwiftUIUIKitExampleTests.swift */; }; + 3F52E449255B816800091058 /* MixedSwiftUIUIKitExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E448255B816800091058 /* MixedSwiftUIUIKitExampleUITests.swift */; }; + 3F52E45D255B823F00091058 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E45C255B823F00091058 /* main.swift */; }; + 3F52E465255B82CD00091058 /* AppLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E464255B82CD00091058 /* AppLauncher.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 3F52E43A255B816800091058 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3F52E41B255B816600091058 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F52E422255B816600091058; + remoteInfo = MixedSwiftUIUIKitExample; + }; + 3F52E445255B816800091058 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3F52E41B255B816600091058 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F52E422255B816600091058; + remoteInfo = MixedSwiftUIUIKitExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 3F52E423255B816600091058 /* MixedSwiftUIUIKitExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MixedSwiftUIUIKitExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F52E426255B816600091058 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 3F52E428255B816600091058 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 3F52E42A255B816600091058 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 3F52E42C255B816700091058 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3F52E42F255B816700091058 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 3F52E432255B816700091058 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3F52E434255B816700091058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F52E439255B816800091058 /* MixedSwiftUIUIKitExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MixedSwiftUIUIKitExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F52E43D255B816800091058 /* MixedSwiftUIUIKitExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedSwiftUIUIKitExampleTests.swift; sourceTree = ""; }; + 3F52E43F255B816800091058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F52E444255B816800091058 /* MixedSwiftUIUIKitExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MixedSwiftUIUIKitExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F52E448255B816800091058 /* MixedSwiftUIUIKitExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedSwiftUIUIKitExampleUITests.swift; sourceTree = ""; }; + 3F52E44A255B816800091058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F52E45C255B823F00091058 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 3F52E464255B82CD00091058 /* AppLauncher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLauncher.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3F52E420255B816600091058 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E436255B816800091058 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E441255B816800091058 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3F52E41A255B816600091058 = { + isa = PBXGroup; + children = ( + 3F52E425255B816600091058 /* MixedSwiftUIUIKitExample */, + 3F52E43C255B816800091058 /* MixedSwiftUIUIKitExampleTests */, + 3F52E447255B816800091058 /* MixedSwiftUIUIKitExampleUITests */, + 3F52E424255B816600091058 /* Products */, + ); + sourceTree = ""; + }; + 3F52E424255B816600091058 /* Products */ = { + isa = PBXGroup; + children = ( + 3F52E423255B816600091058 /* MixedSwiftUIUIKitExample.app */, + 3F52E439255B816800091058 /* MixedSwiftUIUIKitExampleTests.xctest */, + 3F52E444255B816800091058 /* MixedSwiftUIUIKitExampleUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 3F52E425255B816600091058 /* MixedSwiftUIUIKitExample */ = { + isa = PBXGroup; + children = ( + 3F52E426255B816600091058 /* AppDelegate.swift */, + 3F52E464255B82CD00091058 /* AppLauncher.swift */, + 3F52E45C255B823F00091058 /* main.swift */, + 3F52E428255B816600091058 /* SceneDelegate.swift */, + 3F52E42A255B816600091058 /* ContentView.swift */, + 3F52E42C255B816700091058 /* Assets.xcassets */, + 3F52E431255B816700091058 /* LaunchScreen.storyboard */, + 3F52E434255B816700091058 /* Info.plist */, + 3F52E42E255B816700091058 /* Preview Content */, + ); + path = MixedSwiftUIUIKitExample; + sourceTree = ""; + }; + 3F52E42E255B816700091058 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 3F52E42F255B816700091058 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 3F52E43C255B816800091058 /* MixedSwiftUIUIKitExampleTests */ = { + isa = PBXGroup; + children = ( + 3F52E43D255B816800091058 /* MixedSwiftUIUIKitExampleTests.swift */, + 3F52E43F255B816800091058 /* Info.plist */, + ); + path = MixedSwiftUIUIKitExampleTests; + sourceTree = ""; + }; + 3F52E447255B816800091058 /* MixedSwiftUIUIKitExampleUITests */ = { + isa = PBXGroup; + children = ( + 3F52E448255B816800091058 /* MixedSwiftUIUIKitExampleUITests.swift */, + 3F52E44A255B816800091058 /* Info.plist */, + ); + path = MixedSwiftUIUIKitExampleUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3F52E422255B816600091058 /* MixedSwiftUIUIKitExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F52E44D255B816800091058 /* Build configuration list for PBXNativeTarget "MixedSwiftUIUIKitExample" */; + buildPhases = ( + 3F52E41F255B816600091058 /* Sources */, + 3F52E420255B816600091058 /* Frameworks */, + 3F52E421255B816600091058 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MixedSwiftUIUIKitExample; + productName = MixedSwiftUIUIKitExample; + productReference = 3F52E423255B816600091058 /* MixedSwiftUIUIKitExample.app */; + productType = "com.apple.product-type.application"; + }; + 3F52E438255B816800091058 /* MixedSwiftUIUIKitExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F52E450255B816800091058 /* Build configuration list for PBXNativeTarget "MixedSwiftUIUIKitExampleTests" */; + buildPhases = ( + 3F52E435255B816800091058 /* Sources */, + 3F52E436255B816800091058 /* Frameworks */, + 3F52E437255B816800091058 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3F52E43B255B816800091058 /* PBXTargetDependency */, + ); + name = MixedSwiftUIUIKitExampleTests; + productName = MixedSwiftUIUIKitExampleTests; + productReference = 3F52E439255B816800091058 /* MixedSwiftUIUIKitExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 3F52E443255B816800091058 /* MixedSwiftUIUIKitExampleUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F52E453255B816800091058 /* Build configuration list for PBXNativeTarget "MixedSwiftUIUIKitExampleUITests" */; + buildPhases = ( + 3F52E440255B816800091058 /* Sources */, + 3F52E441255B816800091058 /* Frameworks */, + 3F52E442255B816800091058 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3F52E446255B816800091058 /* PBXTargetDependency */, + ); + name = MixedSwiftUIUIKitExampleUITests; + productName = MixedSwiftUIUIKitExampleUITests; + productReference = 3F52E444255B816800091058 /* MixedSwiftUIUIKitExampleUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3F52E41B255B816600091058 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1210; + LastUpgradeCheck = 1210; + TargetAttributes = { + 3F52E422255B816600091058 = { + CreatedOnToolsVersion = 12.1; + }; + 3F52E438255B816800091058 = { + CreatedOnToolsVersion = 12.1; + TestTargetID = 3F52E422255B816600091058; + }; + 3F52E443255B816800091058 = { + CreatedOnToolsVersion = 12.1; + TestTargetID = 3F52E422255B816600091058; + }; + }; + }; + buildConfigurationList = 3F52E41E255B816600091058 /* Build configuration list for PBXProject "MixedSwiftUIUIKitExample" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3F52E41A255B816600091058; + productRefGroup = 3F52E424255B816600091058 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3F52E422255B816600091058 /* MixedSwiftUIUIKitExample */, + 3F52E438255B816800091058 /* MixedSwiftUIUIKitExampleTests */, + 3F52E443255B816800091058 /* MixedSwiftUIUIKitExampleUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3F52E421255B816600091058 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E433255B816700091058 /* LaunchScreen.storyboard in Resources */, + 3F52E430255B816700091058 /* Preview Assets.xcassets in Resources */, + 3F52E42D255B816700091058 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E437255B816800091058 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E442255B816800091058 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3F52E41F255B816600091058 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E427255B816600091058 /* AppDelegate.swift in Sources */, + 3F52E429255B816600091058 /* SceneDelegate.swift in Sources */, + 3F52E45D255B823F00091058 /* main.swift in Sources */, + 3F52E465255B82CD00091058 /* AppLauncher.swift in Sources */, + 3F52E42B255B816600091058 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E435255B816800091058 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E43E255B816800091058 /* MixedSwiftUIUIKitExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E440255B816800091058 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E449255B816800091058 /* MixedSwiftUIUIKitExampleUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 3F52E43B255B816800091058 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F52E422255B816600091058 /* MixedSwiftUIUIKitExample */; + targetProxy = 3F52E43A255B816800091058 /* PBXContainerItemProxy */; + }; + 3F52E446255B816800091058 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F52E422255B816600091058 /* MixedSwiftUIUIKitExample */; + targetProxy = 3F52E445255B816800091058 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 3F52E431255B816700091058 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3F52E432255B816700091058 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3F52E44B255B816800091058 /* 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.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3F52E44C255B816800091058 /* 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.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3F52E44E255B816800091058 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"MixedSwiftUIUIKitExample/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = MixedSwiftUIUIKitExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.MixedSwiftUIUIKitExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3F52E44F255B816800091058 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"MixedSwiftUIUIKitExample/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = MixedSwiftUIUIKitExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.MixedSwiftUIUIKitExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 3F52E451255B816800091058 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MixedSwiftUIUIKitExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.MixedSwiftUIUIKitExampleTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MixedSwiftUIUIKitExample.app/MixedSwiftUIUIKitExample"; + }; + name = Debug; + }; + 3F52E452255B816800091058 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MixedSwiftUIUIKitExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.MixedSwiftUIUIKitExampleTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MixedSwiftUIUIKitExample.app/MixedSwiftUIUIKitExample"; + }; + name = Release; + }; + 3F52E454255B816800091058 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MixedSwiftUIUIKitExampleUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.MixedSwiftUIUIKitExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = MixedSwiftUIUIKitExample; + }; + name = Debug; + }; + 3F52E455255B816800091058 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = MixedSwiftUIUIKitExampleUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.MixedSwiftUIUIKitExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = MixedSwiftUIUIKitExample; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3F52E41E255B816600091058 /* Build configuration list for PBXProject "MixedSwiftUIUIKitExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E44B255B816800091058 /* Debug */, + 3F52E44C255B816800091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F52E44D255B816800091058 /* Build configuration list for PBXNativeTarget "MixedSwiftUIUIKitExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E44E255B816800091058 /* Debug */, + 3F52E44F255B816800091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F52E450255B816800091058 /* Build configuration list for PBXNativeTarget "MixedSwiftUIUIKitExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E451255B816800091058 /* Debug */, + 3F52E452255B816800091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F52E453255B816800091058 /* Build configuration list for PBXNativeTarget "MixedSwiftUIUIKitExampleUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E454255B816800091058 /* Debug */, + 3F52E455255B816800091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3F52E41B255B816600091058 /* Project object */; +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TestAppDelegateExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from TestAppDelegateExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/AppDelegate.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/AppDelegate.swift new file mode 100644 index 0000000..f118ac3 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/AppDelegate.swift @@ -0,0 +1,14 @@ +import UIKit + +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + return true + } + + // MARK: - UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/AppLauncher.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/AppLauncher.swift new file mode 100644 index 0000000..37ed5a8 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/AppLauncher.swift @@ -0,0 +1,30 @@ +import SwiftUI + +// This is an alternative option to what main.swift does. To enable it: +// +// 1. Rename main.swift to something different, e.g. _main.swift, so that it won't act as the main +// entry point of the app anymore +// 2. Comment the UIApplicationMain directive (the compiler will tell you about that) +// 3. Uncomment @main below. +// +// This is not the approach I would endorse because it adds a bit of overhead with the +// TestAppDelegate class and it's not immediately clear what AppLauncher.swift does when scrolling +// through the file list. Having a main.swift file seems clearer. + +//@main +struct AppLauncher { + static func main() throws { + if NSClassFromString("XCTestCase") == nil { + AppDelegate.main() + } else { + TestAppDelegate.main() + } + } +} + +class TestAppDelegate: NSObject, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + return true + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/AccentColor.colorset/Contents.json b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/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/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/Contents.json b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Base.lproj/LaunchScreen.storyboard b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/ContentView.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/ContentView.swift new file mode 100644 index 0000000..0ec9f8a --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/ContentView.swift @@ -0,0 +1,14 @@ +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, world!") + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Info.plist b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Info.plist new file mode 100644 index 0000000..2688b32 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/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 + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Preview Content/Preview Assets.xcassets/Contents.json b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/SceneDelegate.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/SceneDelegate.swift new file mode 100644 index 0000000..e5bbd8f --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/SceneDelegate.swift @@ -0,0 +1,18 @@ +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + let contentView = ContentView() + + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + self.window = window + window.makeKeyAndVisible() + } + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/main.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/main.swift new file mode 100644 index 0000000..5cb834a --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExample/main.swift @@ -0,0 +1,7 @@ +import UIKit + +private func delegateClassName() -> String? { + return NSClassFromString("XCTestCase") == nil ? NSStringFromClass(AppDelegate.self) : nil +} + +UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, delegateClassName()) diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleTests/Info.plist b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleTests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleTests/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/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleTests/MixedSwiftUIUIKitExampleTests.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleTests/MixedSwiftUIUIKitExampleTests.swift new file mode 100644 index 0000000..4fe88fb --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleTests/MixedSwiftUIUIKitExampleTests.swift @@ -0,0 +1,9 @@ +import XCTest +@testable import MixedSwiftUIUIKitExample + +class MixedSwiftUIUIKitExampleTests: XCTestCase { + + func testExample() throws { + XCTAssertEqual(2 + 3, 5) + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleUITests/Info.plist b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleUITests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleUITests/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/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleUITests/MixedSwiftUIUIKitExampleUITests.swift b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleUITests/MixedSwiftUIUIKitExampleUITests.swift new file mode 100644 index 0000000..121dc66 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/MixedSwiftUIUIKitExampleUITests/MixedSwiftUIUIKitExampleUITests.swift @@ -0,0 +1,13 @@ +import XCTest + +class MixedSwiftUIUIKitExampleUITests: XCTestCase { + + override func setUpWithError() throws { + continueAfterFailure = false + } + + func testExample() throws { + let app = XCUIApplication() + app.launch() + } +} diff --git a/Mixed-SwiftUI-UIKit-Example/README.md b/Mixed-SwiftUI-UIKit-Example/README.md new file mode 100644 index 0000000..d47c244 --- /dev/null +++ b/Mixed-SwiftUI-UIKit-Example/README.md @@ -0,0 +1,14 @@ +# How to bypass the `AppDelegate` when running tests - Mixed SwiftUI and UIKit Example + +Create a `main.swift` file and conditionally load the production `UIApplicationDelegate`, returning `nil` if the tests are running. + +```swift +// main.swift +import UIKit + +private func delegateClassName() -> String? { + return NSClassFromString("XCTestCase") == nil ? NSStringFromClass(AppDelegate.self) : nil +} + +UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, delegateClassName()) +``` diff --git a/SwiftUI-Example/README.md b/SwiftUI-Example/README.md new file mode 100644 index 0000000..83f1661 --- /dev/null +++ b/SwiftUI-Example/README.md @@ -0,0 +1,26 @@ +# How to bypass the `App` when running tests - SwiftUI Example + +Create a new type and make it the `@main` for the application. From there, conditionally load the main `App` or a dummy one, depending on whether the tests are running + +```swift +// AppLauncher.swift +import SwiftUI + +@main +struct AppLauncher { + static func main() throws { + if NSClassFromString("XCTestCase") == nil { + MyAwesomeApp.main() // Where `MyAwesomeApp` is the name of your `App` + } else { + TestApp.main() + } + } +} + +struct TestApp: App { + + var body: some Scene { + WindowGroup { Text("Running Unit Tests") } + } +} +`` diff --git a/SwiftUI-Example/TestAppExample.xcodeproj/project.pbxproj b/SwiftUI-Example/TestAppExample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fd72cfa --- /dev/null +++ b/SwiftUI-Example/TestAppExample.xcodeproj/project.pbxproj @@ -0,0 +1,583 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 3F52E3D7255B7E5E00091058 /* TestAppExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E3D6255B7E5E00091058 /* TestAppExampleApp.swift */; }; + 3F52E3D9255B7E5E00091058 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E3D8255B7E5E00091058 /* ContentView.swift */; }; + 3F52E3DB255B7E5F00091058 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F52E3DA255B7E5F00091058 /* Assets.xcassets */; }; + 3F52E3DE255B7E5F00091058 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F52E3DD255B7E5F00091058 /* Preview Assets.xcassets */; }; + 3F52E3E9255B7E6000091058 /* TestAppExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E3E8255B7E6000091058 /* TestAppExampleTests.swift */; }; + 3F52E3F4255B7E6000091058 /* TestAppExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E3F3255B7E6000091058 /* TestAppExampleUITests.swift */; }; + 3F52E408255B7FC700091058 /* AppLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F52E407255B7FC700091058 /* AppLauncher.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 3F52E3E5255B7E6000091058 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3F52E3CB255B7E5E00091058 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F52E3D2255B7E5E00091058; + remoteInfo = TestAppExample; + }; + 3F52E3F0255B7E6000091058 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3F52E3CB255B7E5E00091058 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F52E3D2255B7E5E00091058; + remoteInfo = TestAppExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 3F52E3D3255B7E5E00091058 /* TestAppExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestAppExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F52E3D6255B7E5E00091058 /* TestAppExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestAppExampleApp.swift; sourceTree = ""; }; + 3F52E3D8255B7E5E00091058 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 3F52E3DA255B7E5F00091058 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3F52E3DD255B7E5F00091058 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 3F52E3DF255B7E5F00091058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F52E3E4255B7E6000091058 /* TestAppExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestAppExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F52E3E8255B7E6000091058 /* TestAppExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestAppExampleTests.swift; sourceTree = ""; }; + 3F52E3EA255B7E6000091058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F52E3EF255B7E6000091058 /* TestAppExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestAppExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F52E3F3255B7E6000091058 /* TestAppExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestAppExampleUITests.swift; sourceTree = ""; }; + 3F52E3F5255B7E6000091058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F52E407255B7FC700091058 /* AppLauncher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLauncher.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3F52E3D0255B7E5E00091058 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E3E1255B7E6000091058 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E3EC255B7E6000091058 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3F52E3CA255B7E5E00091058 = { + isa = PBXGroup; + children = ( + 3F52E3D5255B7E5E00091058 /* TestAppExample */, + 3F52E3E7255B7E6000091058 /* TestAppExampleTests */, + 3F52E3F2255B7E6000091058 /* TestAppExampleUITests */, + 3F52E3D4255B7E5E00091058 /* Products */, + ); + sourceTree = ""; + }; + 3F52E3D4255B7E5E00091058 /* Products */ = { + isa = PBXGroup; + children = ( + 3F52E3D3255B7E5E00091058 /* TestAppExample.app */, + 3F52E3E4255B7E6000091058 /* TestAppExampleTests.xctest */, + 3F52E3EF255B7E6000091058 /* TestAppExampleUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 3F52E3D5255B7E5E00091058 /* TestAppExample */ = { + isa = PBXGroup; + children = ( + 3F52E3D6255B7E5E00091058 /* TestAppExampleApp.swift */, + 3F52E407255B7FC700091058 /* AppLauncher.swift */, + 3F52E3D8255B7E5E00091058 /* ContentView.swift */, + 3F52E3DA255B7E5F00091058 /* Assets.xcassets */, + 3F52E3DF255B7E5F00091058 /* Info.plist */, + 3F52E3DC255B7E5F00091058 /* Preview Content */, + ); + path = TestAppExample; + sourceTree = ""; + }; + 3F52E3DC255B7E5F00091058 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 3F52E3DD255B7E5F00091058 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 3F52E3E7255B7E6000091058 /* TestAppExampleTests */ = { + isa = PBXGroup; + children = ( + 3F52E3E8255B7E6000091058 /* TestAppExampleTests.swift */, + 3F52E3EA255B7E6000091058 /* Info.plist */, + ); + path = TestAppExampleTests; + sourceTree = ""; + }; + 3F52E3F2255B7E6000091058 /* TestAppExampleUITests */ = { + isa = PBXGroup; + children = ( + 3F52E3F3255B7E6000091058 /* TestAppExampleUITests.swift */, + 3F52E3F5255B7E6000091058 /* Info.plist */, + ); + path = TestAppExampleUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3F52E3D2255B7E5E00091058 /* TestAppExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F52E3F8255B7E6000091058 /* Build configuration list for PBXNativeTarget "TestAppExample" */; + buildPhases = ( + 3F52E3CF255B7E5E00091058 /* Sources */, + 3F52E3D0255B7E5E00091058 /* Frameworks */, + 3F52E3D1255B7E5E00091058 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestAppExample; + productName = TestAppExample; + productReference = 3F52E3D3255B7E5E00091058 /* TestAppExample.app */; + productType = "com.apple.product-type.application"; + }; + 3F52E3E3255B7E6000091058 /* TestAppExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F52E3FB255B7E6000091058 /* Build configuration list for PBXNativeTarget "TestAppExampleTests" */; + buildPhases = ( + 3F52E3E0255B7E6000091058 /* Sources */, + 3F52E3E1255B7E6000091058 /* Frameworks */, + 3F52E3E2255B7E6000091058 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3F52E3E6255B7E6000091058 /* PBXTargetDependency */, + ); + name = TestAppExampleTests; + productName = TestAppExampleTests; + productReference = 3F52E3E4255B7E6000091058 /* TestAppExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 3F52E3EE255B7E6000091058 /* TestAppExampleUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F52E3FE255B7E6000091058 /* Build configuration list for PBXNativeTarget "TestAppExampleUITests" */; + buildPhases = ( + 3F52E3EB255B7E6000091058 /* Sources */, + 3F52E3EC255B7E6000091058 /* Frameworks */, + 3F52E3ED255B7E6000091058 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3F52E3F1255B7E6000091058 /* PBXTargetDependency */, + ); + name = TestAppExampleUITests; + productName = TestAppExampleUITests; + productReference = 3F52E3EF255B7E6000091058 /* TestAppExampleUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3F52E3CB255B7E5E00091058 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1210; + LastUpgradeCheck = 1210; + TargetAttributes = { + 3F52E3D2255B7E5E00091058 = { + CreatedOnToolsVersion = 12.1; + }; + 3F52E3E3255B7E6000091058 = { + CreatedOnToolsVersion = 12.1; + TestTargetID = 3F52E3D2255B7E5E00091058; + }; + 3F52E3EE255B7E6000091058 = { + CreatedOnToolsVersion = 12.1; + TestTargetID = 3F52E3D2255B7E5E00091058; + }; + }; + }; + buildConfigurationList = 3F52E3CE255B7E5E00091058 /* Build configuration list for PBXProject "TestAppExample" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3F52E3CA255B7E5E00091058; + productRefGroup = 3F52E3D4255B7E5E00091058 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3F52E3D2255B7E5E00091058 /* TestAppExample */, + 3F52E3E3255B7E6000091058 /* TestAppExampleTests */, + 3F52E3EE255B7E6000091058 /* TestAppExampleUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3F52E3D1255B7E5E00091058 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E3DE255B7E5F00091058 /* Preview Assets.xcassets in Resources */, + 3F52E3DB255B7E5F00091058 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E3E2255B7E6000091058 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E3ED255B7E6000091058 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3F52E3CF255B7E5E00091058 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E3D9255B7E5E00091058 /* ContentView.swift in Sources */, + 3F52E3D7255B7E5E00091058 /* TestAppExampleApp.swift in Sources */, + 3F52E408255B7FC700091058 /* AppLauncher.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E3E0255B7E6000091058 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E3E9255B7E6000091058 /* TestAppExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F52E3EB255B7E6000091058 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F52E3F4255B7E6000091058 /* TestAppExampleUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 3F52E3E6255B7E6000091058 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F52E3D2255B7E5E00091058 /* TestAppExample */; + targetProxy = 3F52E3E5255B7E6000091058 /* PBXContainerItemProxy */; + }; + 3F52E3F1255B7E6000091058 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F52E3D2255B7E5E00091058 /* TestAppExample */; + targetProxy = 3F52E3F0255B7E6000091058 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 3F52E3F6255B7E6000091058 /* 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.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3F52E3F7255B7E6000091058 /* 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.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3F52E3F9255B7E6000091058 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"TestAppExample/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = TestAppExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.TestAppExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3F52E3FA255B7E6000091058 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"TestAppExample/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = TestAppExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.TestAppExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 3F52E3FC255B7E6000091058 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestAppExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.TestAppExampleTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestAppExample.app/TestAppExample"; + }; + name = Debug; + }; + 3F52E3FD255B7E6000091058 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestAppExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.TestAppExampleTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestAppExample.app/TestAppExample"; + }; + name = Release; + }; + 3F52E3FF255B7E6000091058 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestAppExampleUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.TestAppExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = TestAppExample; + }; + name = Debug; + }; + 3F52E400255B7E6000091058 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = TestAppExampleUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = mokacoding.TestAppExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = TestAppExample; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3F52E3CE255B7E5E00091058 /* Build configuration list for PBXProject "TestAppExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E3F6255B7E6000091058 /* Debug */, + 3F52E3F7255B7E6000091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F52E3F8255B7E6000091058 /* Build configuration list for PBXNativeTarget "TestAppExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E3F9255B7E6000091058 /* Debug */, + 3F52E3FA255B7E6000091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F52E3FB255B7E6000091058 /* Build configuration list for PBXNativeTarget "TestAppExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E3FC255B7E6000091058 /* Debug */, + 3F52E3FD255B7E6000091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F52E3FE255B7E6000091058 /* Build configuration list for PBXNativeTarget "TestAppExampleUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F52E3FF255B7E6000091058 /* Debug */, + 3F52E400255B7E6000091058 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3F52E3CB255B7E5E00091058 /* Project object */; +} diff --git a/SwiftUI-Example/TestAppExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SwiftUI-Example/TestAppExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/SwiftUI-Example/TestAppExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SwiftUI-Example/TestAppExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SwiftUI-Example/TestAppExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SwiftUI-Example/TestAppExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SwiftUI-Example/TestAppExample.xcodeproj/xcshareddata/xcschemes/TestAppExample.xcscheme b/SwiftUI-Example/TestAppExample.xcodeproj/xcshareddata/xcschemes/TestAppExample.xcscheme new file mode 100644 index 0000000..11dba40 --- /dev/null +++ b/SwiftUI-Example/TestAppExample.xcodeproj/xcshareddata/xcschemes/TestAppExample.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SwiftUI-Example/TestAppExample/AppLauncher.swift b/SwiftUI-Example/TestAppExample/AppLauncher.swift new file mode 100644 index 0000000..cd31258 --- /dev/null +++ b/SwiftUI-Example/TestAppExample/AppLauncher.swift @@ -0,0 +1,19 @@ +import SwiftUI + +@main +struct AppLauncher { + static func main() throws { + if NSClassFromString("XCTestCase") == nil { + TestAppExampleApp.main() + } else { + TestApp.main() + } + } +} + +struct TestApp: App { + + var body: some Scene { + WindowGroup { Text("Running Unit Tests") } + } +} diff --git a/SwiftUI-Example/TestAppExample/Assets.xcassets/AccentColor.colorset/Contents.json b/SwiftUI-Example/TestAppExample/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/SwiftUI-Example/TestAppExample/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SwiftUI-Example/TestAppExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/SwiftUI-Example/TestAppExample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/SwiftUI-Example/TestAppExample/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/SwiftUI-Example/TestAppExample/Assets.xcassets/Contents.json b/SwiftUI-Example/TestAppExample/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/SwiftUI-Example/TestAppExample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SwiftUI-Example/TestAppExample/ContentView.swift b/SwiftUI-Example/TestAppExample/ContentView.swift new file mode 100644 index 0000000..0ec9f8a --- /dev/null +++ b/SwiftUI-Example/TestAppExample/ContentView.swift @@ -0,0 +1,14 @@ +import SwiftUI + +struct ContentView: View { + var body: some View { + Text("Hello, world!") + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/SwiftUI-Example/TestAppExample/Info.plist b/SwiftUI-Example/TestAppExample/Info.plist new file mode 100644 index 0000000..efc211a --- /dev/null +++ b/SwiftUI-Example/TestAppExample/Info.plist @@ -0,0 +1,50 @@ + + + + + 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 + + + UIApplicationSupportsIndirectInputEvents + + UILaunchScreen + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/SwiftUI-Example/TestAppExample/Preview Content/Preview Assets.xcassets/Contents.json b/SwiftUI-Example/TestAppExample/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/SwiftUI-Example/TestAppExample/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SwiftUI-Example/TestAppExample/TestAppExampleApp.swift b/SwiftUI-Example/TestAppExample/TestAppExampleApp.swift new file mode 100644 index 0000000..3f9effe --- /dev/null +++ b/SwiftUI-Example/TestAppExample/TestAppExampleApp.swift @@ -0,0 +1,9 @@ +import SwiftUI + +struct TestAppExampleApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/SwiftUI-Example/TestAppExampleTests/Info.plist b/SwiftUI-Example/TestAppExampleTests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/SwiftUI-Example/TestAppExampleTests/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/SwiftUI-Example/TestAppExampleTests/TestAppExampleTests.swift b/SwiftUI-Example/TestAppExampleTests/TestAppExampleTests.swift new file mode 100644 index 0000000..83a1de7 --- /dev/null +++ b/SwiftUI-Example/TestAppExampleTests/TestAppExampleTests.swift @@ -0,0 +1,10 @@ +import XCTest + +@testable import TestAppExample + +class TestAppExampleTests: XCTestCase { + + func testExample() throws { + XCTAssertEqual(2 + 3, 5) + } +} diff --git a/SwiftUI-Example/TestAppExampleUITests/Info.plist b/SwiftUI-Example/TestAppExampleUITests/Info.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/SwiftUI-Example/TestAppExampleUITests/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/SwiftUI-Example/TestAppExampleUITests/TestAppExampleUITests.swift b/SwiftUI-Example/TestAppExampleUITests/TestAppExampleUITests.swift new file mode 100644 index 0000000..a88a418 --- /dev/null +++ b/SwiftUI-Example/TestAppExampleUITests/TestAppExampleUITests.swift @@ -0,0 +1,24 @@ +import XCTest + +class TestAppExampleUITests: XCTestCase { + + override func setUpWithError() throws { + continueAfterFailure = false + } + + override func tearDownWithError() throws { + } + + func testExample() throws { + let app = XCUIApplication() + app.launch() + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/UIKit-Example/README.md b/UIKit-Example/README.md new file mode 100644 index 0000000..ea95df4 --- /dev/null +++ b/UIKit-Example/README.md @@ -0,0 +1,14 @@ +# How to bypass the `AppDelegate` when running tests - UIKit Example + +Create a `main.swift` file and conditionally load the production `UIApplicationDelegate`, returning `nil` if the tests are running. + +```swift +// main.swift +import UIKit + +private func delegateClassName() -> String? { + return NSClassFromString("XCTestCase") == nil ? NSStringFromClass(AppDelegate.self) : nil +} + +UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, delegateClassName()) +``` diff --git a/TestAppDelegateExample.xcodeproj/project.pbxproj b/UIKit-Example/TestAppDelegateExample.xcodeproj/project.pbxproj similarity index 100% rename from TestAppDelegateExample.xcodeproj/project.pbxproj rename to UIKit-Example/TestAppDelegateExample.xcodeproj/project.pbxproj diff --git a/TestAppDelegateExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/UIKit-Example/TestAppDelegateExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from TestAppDelegateExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to UIKit-Example/TestAppDelegateExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/UIKit-Example/TestAppDelegateExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/UIKit-Example/TestAppDelegateExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/UIKit-Example/TestAppDelegateExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/TestAppDelegateExample.xcodeproj/xcshareddata/xcschemes/TestAppDelegateExample.xcscheme b/UIKit-Example/TestAppDelegateExample.xcodeproj/xcshareddata/xcschemes/TestAppDelegateExample.xcscheme similarity index 100% rename from TestAppDelegateExample.xcodeproj/xcshareddata/xcschemes/TestAppDelegateExample.xcscheme rename to UIKit-Example/TestAppDelegateExample.xcodeproj/xcshareddata/xcschemes/TestAppDelegateExample.xcscheme diff --git a/TestAppDelegateExample/AppDelegate.swift b/UIKit-Example/TestAppDelegateExample/AppDelegate.swift similarity index 100% rename from TestAppDelegateExample/AppDelegate.swift rename to UIKit-Example/TestAppDelegateExample/AppDelegate.swift diff --git a/TestAppDelegateExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/UIKit-Example/TestAppDelegateExample/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from TestAppDelegateExample/Assets.xcassets/AppIcon.appiconset/Contents.json rename to UIKit-Example/TestAppDelegateExample/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/TestAppDelegateExample/Base.lproj/LaunchScreen.storyboard b/UIKit-Example/TestAppDelegateExample/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from TestAppDelegateExample/Base.lproj/LaunchScreen.storyboard rename to UIKit-Example/TestAppDelegateExample/Base.lproj/LaunchScreen.storyboard diff --git a/TestAppDelegateExample/Base.lproj/Main.storyboard b/UIKit-Example/TestAppDelegateExample/Base.lproj/Main.storyboard similarity index 100% rename from TestAppDelegateExample/Base.lproj/Main.storyboard rename to UIKit-Example/TestAppDelegateExample/Base.lproj/Main.storyboard diff --git a/TestAppDelegateExample/Info.plist b/UIKit-Example/TestAppDelegateExample/Info.plist similarity index 100% rename from TestAppDelegateExample/Info.plist rename to UIKit-Example/TestAppDelegateExample/Info.plist diff --git a/TestAppDelegateExample/ViewController.swift b/UIKit-Example/TestAppDelegateExample/ViewController.swift similarity index 100% rename from TestAppDelegateExample/ViewController.swift rename to UIKit-Example/TestAppDelegateExample/ViewController.swift diff --git a/TestAppDelegateExample/main.swift b/UIKit-Example/TestAppDelegateExample/main.swift similarity index 100% rename from TestAppDelegateExample/main.swift rename to UIKit-Example/TestAppDelegateExample/main.swift diff --git a/TestAppDelegateExampleTests/Info.plist b/UIKit-Example/TestAppDelegateExampleTests/Info.plist similarity index 100% rename from TestAppDelegateExampleTests/Info.plist rename to UIKit-Example/TestAppDelegateExampleTests/Info.plist diff --git a/TestAppDelegateExampleTests/TestAppDelegateExampleTests.swift b/UIKit-Example/TestAppDelegateExampleTests/TestAppDelegateExampleTests.swift similarity index 100% rename from TestAppDelegateExampleTests/TestAppDelegateExampleTests.swift rename to UIKit-Example/TestAppDelegateExampleTests/TestAppDelegateExampleTests.swift