wip
This commit is contained in:
parent
442fa3b799
commit
2a80dd1cc2
|
@ -20,7 +20,7 @@ extension View {
|
|||
customize: @escaping (PlatformSpecificView) -> Void
|
||||
) -> some View {
|
||||
if platforms.contains(where: \.isCurrent) {
|
||||
let id = UUID()
|
||||
let id = IntrospectionAnchorID()
|
||||
self.background(
|
||||
IntrospectionAnchorView(
|
||||
id: id
|
||||
|
@ -93,7 +93,7 @@ extension View {
|
|||
extension PlatformView {
|
||||
fileprivate func receiver<PlatformSpecificView: PlatformView>(
|
||||
ofType type: PlatformSpecificView.Type,
|
||||
anchorID: UUID
|
||||
anchorID: IntrospectionAnchorID
|
||||
) -> PlatformSpecificView? {
|
||||
let frontView = self
|
||||
guard
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import SwiftUI
|
||||
|
||||
typealias IntrospectionAnchorID = UUID
|
||||
|
||||
/// ⚓️
|
||||
struct IntrospectionAnchorView: PlatformViewControllerRepresentable {
|
||||
#if canImport(UIKit)
|
||||
|
@ -11,9 +13,9 @@ struct IntrospectionAnchorView: PlatformViewControllerRepresentable {
|
|||
@Binding
|
||||
private var observed: Void // workaround for state changes not triggering view updates
|
||||
|
||||
let id: UUID
|
||||
let id: IntrospectionAnchorID
|
||||
|
||||
init(id: UUID) {
|
||||
init(id: IntrospectionAnchorID) {
|
||||
self._observed = .constant(())
|
||||
self.id = id
|
||||
}
|
||||
|
@ -28,9 +30,9 @@ struct IntrospectionAnchorView: PlatformViewControllerRepresentable {
|
|||
}
|
||||
|
||||
final class IntrospectionAnchorPlatformViewController: PlatformViewController {
|
||||
let id: UUID
|
||||
let id: IntrospectionAnchorID
|
||||
|
||||
init(id: UUID) {
|
||||
init(id: IntrospectionAnchorID) {
|
||||
self.id = id
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue