From cbe985c3e041b67598c1741f2978ffe1ae7210fb Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 12 Mar 2024 19:36:34 +0800 Subject: [PATCH] feat: Compatible with tvOS --- Sources/Internal/View.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/Internal/View.swift b/Sources/Internal/View.swift index 23653c5..84a34a1 100644 --- a/Sources/Internal/View.swift +++ b/Sources/Internal/View.swift @@ -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) @@ -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() {