From 5c40180e2548880aee4357db83890bcde3e50900 Mon Sep 17 00:00:00 2001 From: Sam Deane Date: Tue, 3 Mar 2020 14:07:50 +0000 Subject: [PATCH 1/3] Support building for Catalyst on the Mac When building for Catalyst on the Mac, canImport(AppKit) is true, so you also need to check for !targetEnvironment(macCatalyst). --- Introspect/AppKitIntrospectionView.swift | 2 +- Introspect/ViewExtensions.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Introspect/AppKitIntrospectionView.swift b/Introspect/AppKitIntrospectionView.swift index 8697301f..ae375ff0 100644 --- a/Introspect/AppKitIntrospectionView.swift +++ b/Introspect/AppKitIntrospectionView.swift @@ -1,4 +1,4 @@ -#if canImport(AppKit) +#if canImport(AppKit) && !targetEnvironment(macCatalyst) import SwiftUI import AppKit diff --git a/Introspect/ViewExtensions.swift b/Introspect/ViewExtensions.swift index 409effdf..bbb07bd8 100644 --- a/Introspect/ViewExtensions.swift +++ b/Introspect/ViewExtensions.swift @@ -114,7 +114,7 @@ extension View { } #endif -#if canImport(AppKit) +#if canImport(AppKit) && !targetEnvironment(macCatalyst) extension View { /// Finds a `TargetView` from a `SwiftUI.View` From 86857684ca4ed0d447d12071047b5709505a453a Mon Sep 17 00:00:00 2001 From: Lois Di Qual Date: Wed, 4 Mar 2020 15:24:59 -0800 Subject: [PATCH 2/3] Handle catalyst in tests --- Introspect.xcodeproj/project.pbxproj | 16 ++++++++++------ .../xcschemes/xcschememanagement.plist | 6 +++--- IntrospectTests/AppKitTests.swift | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Introspect.xcodeproj/project.pbxproj b/Introspect.xcodeproj/project.pbxproj index d72f6b35..940b2749 100644 --- a/Introspect.xcodeproj/project.pbxproj +++ b/Introspect.xcodeproj/project.pbxproj @@ -785,7 +785,7 @@ PRODUCT_NAME = Introspect; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SUPPORTS_MACCATALYST = NO; + SUPPORTS_MACCATALYST = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -813,7 +813,7 @@ PRODUCT_NAME = Introspect; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SUPPORTS_MACCATALYST = NO; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -823,8 +823,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 5CYVM7UEHW; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = IntrospectTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -833,6 +833,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.loisdiqual.IntrospectTests; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -842,8 +844,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 5CYVM7UEHW; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = IntrospectTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -852,6 +854,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.loisdiqual.IntrospectTests; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/Introspect.xcodeproj/xcuserdata/ldiqual.xcuserdatad/xcschemes/xcschememanagement.plist b/Introspect.xcodeproj/xcuserdata/ldiqual.xcuserdatad/xcschemes/xcschememanagement.plist index 8fbd6a62..1651105e 100644 --- a/Introspect.xcodeproj/xcuserdata/ldiqual.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Introspect.xcodeproj/xcuserdata/ldiqual.xcuserdatad/xcschemes/xcschememanagement.plist @@ -12,17 +12,17 @@ Introspect macOS.xcscheme_^#shared#^_ orderHint - 3 + 1 Introspect tvOS.xcscheme_^#shared#^_ orderHint - 4 + 2 IntrospectExamples.xcscheme_^#shared#^_ orderHint - 5 + 3 SuppressBuildableAutocreation diff --git a/IntrospectTests/AppKitTests.swift b/IntrospectTests/AppKitTests.swift index 2413d66a..ba716b02 100644 --- a/IntrospectTests/AppKitTests.swift +++ b/IntrospectTests/AppKitTests.swift @@ -1,4 +1,4 @@ -#if canImport(AppKit) +#if canImport(AppKit) && !targetEnvironment(macCatalyst) import XCTest import SwiftUI From b9fc8f38b118dc157cee3dc5a75cdb85ff462373 Mon Sep 17 00:00:00 2001 From: Lois Di Qual Date: Wed, 4 Mar 2020 15:25:29 -0800 Subject: [PATCH 3/3] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f085c18..b5cf0839 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changelog ## [0.1.0] - Added `macOS` and `tvOS` support. + - Added Catalyst support in the Introspect iOS framework. ## [0.0.6]