diff --git a/Package.swift b/Package.swift index a1cf476..0c006ac 100644 --- a/Package.swift +++ b/Package.swift @@ -6,23 +6,23 @@ import PackageDescription let permissionsTargets: [Target] = [ .target( name: "CorePermissionsSwiftUI", //Internal module for shared code - dependencies: ["Introspect"], + dependencies: ["SwiftUIIntrospect"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], resources: [.process("Resources")] ), .target( name: "PermissionsSwiftUI", //Maintain backward compatibility - access to all permissions - dependencies: ["Introspect", "CorePermissionsSwiftUI", "PermissionsSwiftUITracking", "PermissionsSwiftUIBluetooth", "PermissionsSwiftUICalendar", "PermissionsSwiftUICamera", "PermissionsSwiftUIContacts", "PermissionsSwiftUILocation", "PermissionsSwiftUILocationAlways", "PermissionsSwiftUIMicrophone", "PermissionsSwiftUIMotion", "PermissionsSwiftUIMusic", "PermissionsSwiftUINotification", "PermissionsSwiftUIPhoto", "PermissionsSwiftUIReminder", "PermissionsSwiftUISpeech", "PermissionsSwiftUIHealth"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI", "PermissionsSwiftUITracking", "PermissionsSwiftUIBluetooth", "PermissionsSwiftUICalendar", "PermissionsSwiftUICamera", "PermissionsSwiftUIContacts", "PermissionsSwiftUILocation", "PermissionsSwiftUILocationAlways", "PermissionsSwiftUIMicrophone", "PermissionsSwiftUIMotion", "PermissionsSwiftUIMusic", "PermissionsSwiftUINotification", "PermissionsSwiftUIPhoto", "PermissionsSwiftUIReminder", "PermissionsSwiftUISpeech", "PermissionsSwiftUIHealth"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUIBluetooth", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUICalendar", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_EVENT") @@ -30,17 +30,17 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUICamera", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUIContacts", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUIHealth", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_HEALTH") @@ -48,7 +48,7 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUILocationAlways", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_LOCATION") @@ -56,7 +56,7 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUILocation", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_LOCATION") @@ -64,22 +64,22 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUIMicrophone", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUIMotion", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUIMusic", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUINotification", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_NOTIFICATION") @@ -87,7 +87,7 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUIPhoto", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_PHOTO") @@ -95,7 +95,7 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUIReminder", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"], swiftSettings: [ .define("PERMISSIONSWIFTUI_EVENT") @@ -103,22 +103,22 @@ let permissionsTargets: [Target] = [ ), .target( name: "PermissionsSwiftUISpeech", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUITracking", - dependencies: ["Introspect", .target(name: "CorePermissionsSwiftUI")], + dependencies: ["SwiftUIIntrospect", .target(name: "CorePermissionsSwiftUI")], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUISiri", - dependencies: ["Introspect", "CorePermissionsSwiftUI"], + dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"], exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"] ), .target( name: "PermissionsSwiftUIBiometrics", - dependencies: ["Introspect", .target(name: "CorePermissionsSwiftUI")], + dependencies: ["SwiftUIIntrospect", .target(name: "CorePermissionsSwiftUI")], exclude: ["../../Tsts/PermissionsSwiftUITests/__Snapshots__"] )] @@ -130,7 +130,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. .package(name: "SnapshotTesting", url: "https://github.com/pointfreeco/swift-snapshot-testing.git", "1.0.0"..<"2.0.0"), - .package(name: "Introspect", url: "https://github.com/siteline/SwiftUI-Introspect", "0.0.0"..<"1.0.0") + .package(name: "SwiftUIIntrospect", url: "https://github.com/siteline/SwiftUI-Introspect", "1.0.0"..<"2.0.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -148,4 +148,4 @@ let package = Package( ), ] + permissionsTargets -) \ No newline at end of file +) diff --git a/PermissionsSwiftUI.podspec b/PermissionsSwiftUI.podspec index df455c4..c28c03a 100644 --- a/PermissionsSwiftUI.podspec +++ b/PermissionsSwiftUI.podspec @@ -15,6 +15,6 @@ PermissionsSwiftUI can display either a modal or alert popover to show an intera s.ios.deployment_target = '11.0' s.source_files = 'Sources/**/*.swift', 'Sources/**/**/*.swift', 'Sources/**/**/**/*.swift' - s.dependency 'Introspect' + s.dependency 'SwiftUIIntrospect', '~> 1.0' s.dependency 'PermissionsSwiftUI/CorePermissionsSwiftUI' end diff --git a/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalView.swift b/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalView.swift index 72341b9..1b7b813 100644 --- a/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalView.swift +++ b/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalView.swift @@ -6,6 +6,7 @@ // import SwiftUI +import SwiftUIIntrospect @available(iOS 13.0, tvOS 13.0, *) struct ModalView: View { @@ -39,11 +40,11 @@ struct ModalView: View { } .background(Color(.secondarySystemBackground)) .edgesIgnoringSafeArea(.all) - .introspectViewController{ + .introspect(.viewController, on: .iOS(.v13, .v14, .v15, .v16, .v17)) { viewControler in if store.configStore.restrictDismissal || store.restrictAlertDismissal || store.restrictModalDismissal { - $0.isModalInPresentation = true + viewControler.isModalInPresentation = true } } } diff --git a/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalViewWrapper.swift b/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalViewWrapper.swift index 4f79e01..349e548 100644 --- a/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalViewWrapper.swift +++ b/Sources/CorePermissionsSwiftUI/SwiftUI/Modal-style/ModalViewWrapper.swift @@ -6,7 +6,6 @@ // import SwiftUI -import Introspect @available(iOS 13.0, tvOS 13.0, *) @usableFromInline struct ModalViewWrapper: View, CustomizableView {