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