Skip to content

Commit 3eeab8d

Browse files
authored
Compile fix for visionOS (#19)
* Compile fix for visionOS
1 parent b96668e commit 3eeab8d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/TGCardViewController/TGCardViewController.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ open class TGCardViewController: UIViewController {
193193
var panner: UIPanGestureRecognizer!
194194
var cardTapper: UITapGestureRecognizer!
195195
var mapShadowTapper: UITapGestureRecognizer!
196+
#if !os(visionOS)
196197
var edgePanner: UIScreenEdgePanGestureRecognizer!
198+
#endif
197199

198200
/// Builder that determines what kind of map to use. The builder's
199201
/// `buildMapView` method will be once initially, and the map instance will
@@ -371,13 +373,15 @@ open class TGCardViewController: UIViewController {
371373
mapShadow.addGestureRecognizer(mapTapper)
372374
self.mapShadowTapper = mapTapper
373375

376+
#if !os(visionOS)
374377
// Edge panning to go back
375378
let edgePanner = UIScreenEdgePanGestureRecognizer()
376379
edgePanner.addTarget(self, action: #selector(popMaybe))
377380
edgePanner.isEnabled = mode == .floating
378381
edgePanner.edges = traitCollection.layoutDirection == .leftToRight ? .left : .right
379382
view.addGestureRecognizer(edgePanner)
380383
self.edgePanner = edgePanner
384+
#endif
381385
}
382386

383387
override open func viewWillAppear(_ animated: Bool) {
@@ -1971,7 +1975,10 @@ extension TGCardViewController {
19711975
} else if !headerIsVisible {
19721976
headerStatusBarStyle = nil
19731977
}
1978+
1979+
#if !os(visionOS)
19741980
setNeedsStatusBarAppearanceUpdate()
1981+
#endif
19751982
}
19761983

19771984
}
@@ -2114,19 +2121,22 @@ extension TGCardViewController {
21142121
object: nil
21152122
)
21162123

2124+
#if !os(visionOS)
21172125
NotificationCenter.default.addObserver(
21182126
self,
21192127
selector: #selector(updateForVoiceOverFocusChange),
21202128
name: UIAccessibility.elementFocusedNotification,
21212129
object: nil
21222130
)
2131+
#endif
21232132
}
21242133

21252134
@objc
21262135
private func updateForVoiceOverStatusChange() {
21272136
updateCardScrolling(allow: cardPosition == .extended, view: topCardView)
21282137
}
21292138

2139+
#if !os(visionOS)
21302140
@objc
21312141
private func updateForVoiceOverFocusChange(notification: Notification) {
21322142
guard let selection = notification.userInfo?[UIAccessibility.focusedElementUserInfoKey] as? UIAccessibilityElement else { return }
@@ -2139,6 +2149,7 @@ extension TGCardViewController {
21392149
switchTo(.extended, direction: .up, animated: true)
21402150
}
21412151
}
2152+
#endif
21422153

21432154
private func buildCardHandleAccessibilityActions() -> [UIAccessibilityCustomAction] {
21442155
return [

0 commit comments

Comments
 (0)