Skip to content

Commit

Permalink
feat: Compatible with tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-i committed Mar 12, 2024
1 parent be9151f commit cbe985c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/Internal/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ extension BlankSlate {
addGestureRecognizer(tap)
tapGesture = tap

#if !os(tvOS)
NotificationCenter.default.addObserver(
self,
selector: #selector(updateForCurrentOrientation),
name: UIApplication.didChangeStatusBarOrientationNotification,
object: nil)
#endif
}

@available(*, unavailable)
Expand All @@ -118,10 +120,12 @@ extension BlankSlate {
}

deinit {
#if !os(tvOS)
NotificationCenter.default.removeObserver(self)
#if DEBUG
#endif
#if DEBUG
print("👍🏻👍🏻👍🏻 BlankSlate.View is released.")
#endif
#endif
}

override func didMoveToSuperview() {
Expand Down

0 comments on commit cbe985c

Please sign in to comment.