diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 21f958f..9dc3345 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -4,19 +4,19 @@ on: workflow_dispatch: push: paths: - - 'Sources/**' - - 'Tests/**' - - '!Sources/Documentation.docc/**' + - "Sources/**" + - "Tests/**" + - "!Sources/Documentation.docc/**" pull_request: paths: - - 'Sources/**' - - 'Tests/**' - - '!Sources/Documentation.docc/**' + - "Sources/**" + - "Tests/**" + - "!Sources/Documentation.docc/**" jobs: iOS: name: Build and test on iOS - runs-on: macOS-12 + runs-on: macos-14 steps: - uses: actions/checkout@v3 - name: Build @@ -25,7 +25,7 @@ jobs: run: xcodebuild test-without-building -scheme WhatsNewKit -destination 'platform=iOS Simulator,name=iPhone 14' macOS: name: Build and test on macOS - runs-on: macos-latest + runs-on: macos-14 steps: - uses: actions/checkout@v3 - name: Build diff --git a/.github/workflows/build_example_project.yml b/.github/workflows/build_example_project.yml index 1504b02..a43e69f 100644 --- a/.github/workflows/build_example_project.yml +++ b/.github/workflows/build_example_project.yml @@ -4,17 +4,17 @@ on: workflow_dispatch: push: paths: - - 'Example/**' - - 'Sources/**' + - "Example/**" + - "Sources/**" pull_request: paths: - - 'Example/**' - - 'Sources/**' + - "Example/**" + - "Sources/**" jobs: build: name: Build iOS example project - runs-on: macOS-12 + runs-on: macos-14 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/deploy_documentation.yml b/.github/workflows/deploy_documentation.yml index 519bc61..99c1bf4 100644 --- a/.github/workflows/deploy_documentation.yml +++ b/.github/workflows/deploy_documentation.yml @@ -5,7 +5,7 @@ on: push: branches: - main - + permissions: contents: read pages: write @@ -17,7 +17,7 @@ concurrency: jobs: build: - runs-on: macos-12 + runs-on: macos-14 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 04cf8f6..22315ac 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -10,12 +10,7 @@ 3D5FCF782767887F00D3211F /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5FCF772767887F00D3211F /* App.swift */; }; 3D5FCF7A2767887F00D3211F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5FCF792767887F00D3211F /* ContentView.swift */; }; 3D5FCF88276788FE00D3211F /* WhatsNewKit in Frameworks */ = {isa = PBXBuildFile; productRef = 3D5FCF87276788FE00D3211F /* WhatsNewKit */; }; - 3D9996C8276E112A00438FB6 /* ExamplesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA482052769E7F900F526B0 /* ExamplesView.swift */; }; - 3D9996C9276E112C00438FB6 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5FCF792767887F00D3211F /* ContentView.swift */; }; - 3D9996CB276E113100438FB6 /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5FCF772767887F00D3211F /* App.swift */; }; - 3D9996CD276E118C00438FB6 /* WhatsNewKit in Frameworks */ = {isa = PBXBuildFile; productRef = 3D9996CC276E118C00438FB6 /* WhatsNewKit */; }; - 3D999702276E141A00438FB6 /* Assets-macOS.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D999701276E141A00438FB6 /* Assets-macOS.xcassets */; }; - 3D999705276E144B00438FB6 /* Assets-iOS.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D999703276E144800438FB6 /* Assets-iOS.xcassets */; }; + 3D999705276E144B00438FB6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D999703276E144800438FB6 /* Assets.xcassets */; }; 3DA482062769E7F900F526B0 /* ExamplesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DA482052769E7F900F526B0 /* ExamplesView.swift */; }; /* End PBXBuildFile section */ @@ -24,10 +19,7 @@ 3D5FCF772767887F00D3211F /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = ""; }; 3D5FCF792767887F00D3211F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 3D5FCF85276788F900D3211F /* WhatsNewKit */ = {isa = PBXFileReference; lastKnownFileType = folder; name = WhatsNewKit; path = ..; sourceTree = ""; }; - 3D9996B8276E10CE00438FB6 /* Example-macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-macOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3D9996C3276E10D000438FB6 /* Entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Entitlements.entitlements; sourceTree = ""; }; - 3D999701276E141A00438FB6 /* Assets-macOS.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Assets-macOS.xcassets"; sourceTree = ""; }; - 3D999703276E144800438FB6 /* Assets-iOS.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Assets-iOS.xcassets"; sourceTree = ""; }; + 3D999703276E144800438FB6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 3DA482052769E7F900F526B0 /* ExamplesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExamplesView.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -40,14 +32,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 3D9996B5276E10CE00438FB6 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D9996CD276E118C00438FB6 /* WhatsNewKit in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -65,7 +49,6 @@ isa = PBXGroup; children = ( 3D5FCF742767887F00D3211F /* WhatsNewKit-Example.app */, - 3D9996B8276E10CE00438FB6 /* Example-macOS.app */, ); name = Products; sourceTree = ""; @@ -76,7 +59,7 @@ 3D5FCF772767887F00D3211F /* App.swift */, 3D5FCF792767887F00D3211F /* ContentView.swift */, 3DA482052769E7F900F526B0 /* ExamplesView.swift */, - 3D999700276E131F00438FB6 /* Resources */, + 3D999703276E144800438FB6 /* Assets.xcassets */, ); path = Example; sourceTree = ""; @@ -88,22 +71,12 @@ name = Frameworks; sourceTree = ""; }; - 3D999700276E131F00438FB6 /* Resources */ = { - isa = PBXGroup; - children = ( - 3D999703276E144800438FB6 /* Assets-iOS.xcassets */, - 3D999701276E141A00438FB6 /* Assets-macOS.xcassets */, - 3D9996C3276E10D000438FB6 /* Entitlements.entitlements */, - ); - path = Resources; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 3D5FCF732767887E00D3211F /* Example-iOS */ = { + 3D5FCF732767887E00D3211F /* Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 3D5FCF822767888000D3211F /* Build configuration list for PBXNativeTarget "Example-iOS" */; + buildConfigurationList = 3D5FCF822767888000D3211F /* Build configuration list for PBXNativeTarget "Example" */; buildPhases = ( 3D5FCF702767887E00D3211F /* Sources */, 3D5FCF712767887E00D3211F /* Frameworks */, @@ -113,7 +86,7 @@ ); dependencies = ( ); - name = "Example-iOS"; + name = Example; packageProductDependencies = ( 3D5FCF87276788FE00D3211F /* WhatsNewKit */, ); @@ -121,26 +94,6 @@ productReference = 3D5FCF742767887F00D3211F /* WhatsNewKit-Example.app */; productType = "com.apple.product-type.application"; }; - 3D9996B7276E10CE00438FB6 /* Example-macOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3D9996C4276E10D000438FB6 /* Build configuration list for PBXNativeTarget "Example-macOS" */; - buildPhases = ( - 3D9996B4276E10CE00438FB6 /* Sources */, - 3D9996B5276E10CE00438FB6 /* Frameworks */, - 3D9996B6276E10CE00438FB6 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Example-macOS"; - packageProductDependencies = ( - 3D9996CC276E118C00438FB6 /* WhatsNewKit */, - ); - productName = "Example-macOS"; - productReference = 3D9996B8276E10CE00438FB6 /* Example-macOS.app */; - productType = "com.apple.product-type.application"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -149,14 +102,11 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1320; - LastUpgradeCheck = 1320; + LastUpgradeCheck = 1520; TargetAttributes = { 3D5FCF732767887E00D3211F = { CreatedOnToolsVersion = 13.1; }; - 3D9996B7276E10CE00438FB6 = { - CreatedOnToolsVersion = 13.2; - }; }; }; buildConfigurationList = 3D5FCF6F2767887E00D3211F /* Build configuration list for PBXProject "Example" */; @@ -172,8 +122,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 3D5FCF732767887E00D3211F /* Example-iOS */, - 3D9996B7276E10CE00438FB6 /* Example-macOS */, + 3D5FCF732767887E00D3211F /* Example */, ); }; /* End PBXProject section */ @@ -183,15 +132,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3D999705276E144B00438FB6 /* Assets-iOS.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3D9996B6276E10CE00438FB6 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D999702276E141A00438FB6 /* Assets-macOS.xcassets in Resources */, + 3D999705276E144B00438FB6 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -208,16 +149,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 3D9996B4276E10CE00438FB6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D9996C9276E112C00438FB6 /* ContentView.swift in Sources */, - 3D9996CB276E113100438FB6 /* App.swift in Sources */, - 3D9996C8276E112A00438FB6 /* ExamplesView.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -258,6 +189,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -272,7 +204,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -319,6 +251,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -327,7 +260,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -340,7 +273,7 @@ 3D5FCF832767888000D3211F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-iOS"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -352,23 +285,29 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "de.tiigi.WhatsNewKit.Example-iOS"; PRODUCT_NAME = "WhatsNewKit-Example"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = "1,2,7"; }; name = Debug; }; 3D5FCF842767888000D3211F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-iOS"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; @@ -380,72 +319,22 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = "de.tiigi.WhatsNewKit.Example-iOS"; PRODUCT_NAME = "WhatsNewKit-Example"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 3D9996C5276E10D000438FB6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-macOS"; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = Example/Resources/Entitlements.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = ""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 12.1; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "de.tiigi.WhatsNewKit.Example-macOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 3D9996C6276E10D000438FB6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-macOS"; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = Example/Resources/Entitlements.entitlements; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = ""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 12.1; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "de.tiigi.WhatsNewKit.Example-macOS"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; }; name = Release; }; @@ -461,7 +350,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3D5FCF822767888000D3211F /* Build configuration list for PBXNativeTarget "Example-iOS" */ = { + 3D5FCF822767888000D3211F /* Build configuration list for PBXNativeTarget "Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 3D5FCF832767888000D3211F /* Debug */, @@ -470,15 +359,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3D9996C4276E10D000438FB6 /* Build configuration list for PBXNativeTarget "Example-macOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3D9996C5276E10D000438FB6 /* Debug */, - 3D9996C6276E10D000438FB6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ @@ -486,10 +366,6 @@ isa = XCSwiftPackageProductDependency; productName = WhatsNewKit; }; - 3D9996CC276E118C00438FB6 /* WhatsNewKit */ = { - isa = XCSwiftPackageProductDependency; - productName = WhatsNewKit; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 3D5FCF6C2767887E00D3211F /* Project object */; diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme deleted file mode 100644 index b98877e..0000000 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme similarity index 94% rename from Example/Example.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme rename to Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index da2bdc1..2e077aa 100644 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme +++ b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +46,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "3D5FCF732767887E00D3211F" BuildableName = "WhatsNewKit-Example.app" - BlueprintName = "Example-iOS" + BlueprintName = "Example" ReferencedContainer = "container:Example.xcodeproj"> @@ -63,7 +63,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "3D5FCF732767887E00D3211F" BuildableName = "WhatsNewKit-Example.app" - BlueprintName = "Example-iOS" + BlueprintName = "Example" ReferencedContainer = "container:Example.xcodeproj"> diff --git a/Example/Example/Resources/Assets-iOS.xcassets/AccentColor.colorset/Contents.json b/Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from Example/Example/Resources/Assets-iOS.xcassets/AccentColor.colorset/Contents.json rename to Example/Example/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/Example/Example/Resources/Assets-iOS.xcassets/AppIcon-iOS.appiconset/AppIcon-1024px.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/AppIcon-1024px.png similarity index 100% rename from Example/Example/Resources/Assets-iOS.xcassets/AppIcon-iOS.appiconset/AppIcon-1024px.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/AppIcon-1024px.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/Contents.json b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 91% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/Contents.json rename to Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json index f93a293..d2ac95b 100644 --- a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/Contents.json +++ b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,11 @@ { "images" : [ + { + "filename" : "AppIcon-1024px.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, { "filename" : "macOS-AppIcon-16px-16pt@1x.png", "idiom" : "mac", diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-1024px.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-1024px.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-1024px.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-1024px.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-128px-128pt@1x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-128px-128pt@1x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-128px-128pt@1x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-128px-128pt@1x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-16px-16pt@1x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-16px-16pt@1x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-16px-16pt@1x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-16px-16pt@1x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-256px-128pt@2x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-256px-128pt@2x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-256px-128pt@2x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-256px-128pt@2x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-256px-256pt@1x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-256px-256pt@1x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-256px-256pt@1x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-256px-256pt@1x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-32px-16pt@2x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-32px-16pt@2x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-32px-16pt@2x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-32px-16pt@2x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-32px-32pt@1x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-32px-32pt@1x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-32px-32pt@1x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-32px-32pt@1x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-512px-256pt@2x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-512px-256pt@2x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-512px-256pt@2x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-512px-256pt@2x.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-512px.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-512px.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-512px.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-512px.png diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-64px-32pt@2x.png b/Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-64px-32pt@2x.png similarity index 100% rename from Example/Example/Resources/Assets-macOS.xcassets/AppIcon-macOS.appiconset/macOS-AppIcon-64px-32pt@2x.png rename to Example/Example/Assets.xcassets/AppIcon.appiconset/macOS-AppIcon-64px-32pt@2x.png diff --git a/Example/Example/Resources/Assets-iOS.xcassets/Contents.json b/Example/Example/Assets.xcassets/Contents.json similarity index 100% rename from Example/Example/Resources/Assets-iOS.xcassets/Contents.json rename to Example/Example/Assets.xcassets/Contents.json diff --git a/Example/Example/ContentView.swift b/Example/Example/ContentView.swift index 278a0b1..5af7366 100644 --- a/Example/Example/ContentView.swift +++ b/Example/Example/ContentView.swift @@ -12,15 +12,8 @@ extension ContentView: View { /// The content and behavior of the view var body: some View { - Group { - #if os(macOS) + NavigationStack { ExamplesView() - #else - NavigationView { - ExamplesView() - } - .navigationViewStyle(.stack) - #endif } .whatsNewSheet() } diff --git a/Example/Example/Resources/Assets-iOS.xcassets/AppIcon-iOS.appiconset/Contents.json b/Example/Example/Resources/Assets-iOS.xcassets/AppIcon-iOS.appiconset/Contents.json deleted file mode 100644 index 9241206..0000000 --- a/Example/Example/Resources/Assets-iOS.xcassets/AppIcon-iOS.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images" : [ - { - "filename" : "AppIcon-1024px.png", - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example/Example/Resources/Assets-macOS.xcassets/AccentColor.colorset/Contents.json b/Example/Example/Resources/Assets-macOS.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index 6112869..0000000 --- a/Example/Example/Resources/Assets-macOS.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "platform" : "universal", - "reference" : "systemBlueColor" - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example/Example/Resources/Assets-macOS.xcassets/Contents.json b/Example/Example/Resources/Assets-macOS.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Example/Example/Resources/Assets-macOS.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Example/Example/Resources/Entitlements.entitlements b/Example/Example/Resources/Entitlements.entitlements deleted file mode 100644 index f2ef3ae..0000000 --- a/Example/Example/Resources/Entitlements.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.files.user-selected.read-only - - - diff --git a/Package.swift b/Package.swift index fa03e7e..35e20b8 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version: 5.9 import PackageDescription @@ -6,12 +6,15 @@ let package = Package( name: "WhatsNewKit", platforms: [ .iOS(.v13), - .macOS(.v11) + .macOS(.v11), + .visionOS(.v1) ], products: [ .library( name: "WhatsNewKit", - targets: ["WhatsNewKit"] + targets: [ + "WhatsNewKit" + ] ) ], targets: [ @@ -21,7 +24,9 @@ let package = Package( ), .testTarget( name: "WhatsNewKitTests", - dependencies: ["WhatsNewKit"], + dependencies: [ + "WhatsNewKit" + ], path: "Tests" ) ] diff --git a/README.md b/README.md index 570f36e..3e0ea3a 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ struct ContentView: View { - [x] Easily present your new app features 🤩 - [x] Automatic & Manual presentation mode ✅ - [x] Support for SwiftUI, UIKit and AppKit 🧑‍🎨 -- [x] Runs on iOS and macOS 📱 🖥 +- [x] Runs on iOS, macOS and visionOS 📱 🖥 👓 - [x] Adjustable layout 🔧 ## Installation @@ -530,28 +530,3 @@ guard let whatsNewViewController = WhatsNewViewController( // WhatsNewVersionStore when the WhatsNewViewController gets dismissed self.present(whatsNewViewController, animated: true) ``` - -## License - -``` -WhatsNewKit -Copyright (c) 2022 Sven Tiigi sven.tiigi@gmail.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -``` diff --git a/Sources/Extensions/Text+WhatsNewText.swift b/Sources/Extensions/Text+WhatsNewText.swift index 702864d..0f11e05 100644 --- a/Sources/Extensions/Text+WhatsNewText.swift +++ b/Sources/Extensions/Text+WhatsNewText.swift @@ -10,7 +10,7 @@ extension Text { whatsNewText: WhatsNew.Text ) { // Check if iOS 15 or greater is available - if #available(iOS 15.0, macOS 12.0, *) { + if #available(iOS 15.0, macOS 12.0, visionOS 1.0, *) { // Initialize with AttributedString self.init( AttributedString( diff --git a/Sources/Models/WhatsNew+HapticFeedback.swift b/Sources/Models/WhatsNew+HapticFeedback.swift index 3ee87e8..b13d8f0 100644 --- a/Sources/Models/WhatsNew+HapticFeedback.swift +++ b/Sources/Models/WhatsNew+HapticFeedback.swift @@ -9,7 +9,7 @@ public extension WhatsNew { /// The WhatsNew HapticFeedback enum HapticFeedback: Hashable { - #if os(iOS) + #if os(iOS) && !os(visionOS) /// Impact HapticFeedback case impact( style: UIImpactFeedbackGenerator.FeedbackStyle? = nil, @@ -32,7 +32,7 @@ public extension WhatsNew.HapticFeedback { /// Call HapticFeedback as function to execute the HapticFeedback func callAsFunction() { - #if os(iOS) + #if os(iOS) && !os(visionOS) switch self { case .impact(let style, let intensity): let feedbackGenerator = style.flatMap(UIImpactFeedbackGenerator.init) ?? .init() diff --git a/Sources/Models/WhatsNew+SecondaryAction.swift b/Sources/Models/WhatsNew+SecondaryAction.swift index 2d840fa..f1b9798 100644 --- a/Sources/Models/WhatsNew+SecondaryAction.swift +++ b/Sources/Models/WhatsNew+SecondaryAction.swift @@ -31,7 +31,13 @@ public extension WhatsNew { /// - action: The Action public init( title: Text, - foregroundColor: Color = .accentColor, + foregroundColor: Color = { + #if os(visionOS) + .primary + #else + .accentColor + #endif + }(), hapticFeedback: HapticFeedback? = nil, action: Action ) { diff --git a/Sources/View/WhatsNewView+FeaturesPadding.swift b/Sources/View/WhatsNewView+FeaturesPadding.swift index 8b70ad1..21ace7a 100644 --- a/Sources/View/WhatsNewView+FeaturesPadding.swift +++ b/Sources/View/WhatsNewView+FeaturesPadding.swift @@ -7,7 +7,7 @@ extension WhatsNewView { /// The WhatsNewView FeaturesPadding ViewModifier struct FeaturesPadding { - #if os(iOS) + #if os(iOS) || os(visionOS) /// The Horizontal SizeClass @Environment(\.horizontalSizeClass) private var horizontalSizeClass diff --git a/Sources/View/WhatsNewView+FooterPadding.swift b/Sources/View/WhatsNewView+FooterPadding.swift index 8418714..34b2580 100644 --- a/Sources/View/WhatsNewView+FooterPadding.swift +++ b/Sources/View/WhatsNewView+FooterPadding.swift @@ -7,7 +7,7 @@ extension WhatsNewView { /// The WhatsNewView FooterPadding ViewModifier struct FooterPadding { - #if os(iOS) + #if os(iOS) || os(visionOS) /// The Horizontal SizeClass @Environment(\.horizontalSizeClass) private var horizontalSizeClass diff --git a/Tests/WhatsNewVersionStoreTests.swift b/Tests/WhatsNewVersionStoreTests.swift index 42e0d96..6127660 100644 --- a/Tests/WhatsNewVersionStoreTests.swift +++ b/Tests/WhatsNewVersionStoreTests.swift @@ -67,6 +67,10 @@ final class WhatsNewVersionStoreTests: WhatsNewKitTestCase { override func set(_ value: Any?, forKey defaultName: String) { self.store[defaultName] = value } + + override func removeObject(forKey aKey: String) { + self.store.removeValue(forKey: aKey) + } } let fakeNSUbiquitousKeyValueStore = FakeNSUbiquitousKeyValueStore() let ubiquitousKeyValueWhatsNewVersionStore = NSUbiquitousKeyValueWhatsNewVersionStore(