Skip to content

Commit

Permalink
Update to SwiftUIIntrospect and remove Introspect
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasrichardrichter committed Feb 26, 2024
1 parent bd4ef03 commit 1b3913b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
42 changes: 21 additions & 21 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,119 +6,119 @@ 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")
]
),
.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")
]
),
.target(
name: "PermissionsSwiftUILocationAlways",
dependencies: ["Introspect", "CorePermissionsSwiftUI"],
dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"],
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"],
swiftSettings: [
.define("PERMISSIONSWIFTUI_LOCATION")
]
),
.target(
name: "PermissionsSwiftUILocation",
dependencies: ["Introspect", "CorePermissionsSwiftUI"],
dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"],
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"],
swiftSettings: [
.define("PERMISSIONSWIFTUI_LOCATION")
]
),
.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")
]
),
.target(
name: "PermissionsSwiftUIPhoto",
dependencies: ["Introspect", "CorePermissionsSwiftUI"],
dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"],
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"],
swiftSettings: [
.define("PERMISSIONSWIFTUI_PHOTO")
]
),
.target(
name: "PermissionsSwiftUIReminder",
dependencies: ["Introspect", "CorePermissionsSwiftUI"],
dependencies: ["SwiftUIIntrospect", "CorePermissionsSwiftUI"],
exclude: ["../../Tests/PermissionsSwiftUITests/__Snapshots__"],
swiftSettings: [
.define("PERMISSIONSWIFTUI_EVENT")
]
),
.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__"]
)]

Expand All @@ -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.
Expand All @@ -148,4 +148,4 @@ let package = Package(
),

] + permissionsTargets
)
)
2 changes: 1 addition & 1 deletion PermissionsSwiftUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SwiftUIIntrospect

@available(iOS 13.0, tvOS 13.0, *)
struct ModalView: View {
Expand Down Expand Up @@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import Introspect

@available(iOS 13.0, tvOS 13.0, *)
@usableFromInline struct ModalViewWrapper<Body: View>: View, CustomizableView {
Expand Down

0 comments on commit 1b3913b

Please sign in to comment.