mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Hide on-screen navigation when in fullscreen media view
This commit is contained in:
@@ -7,7 +7,7 @@ private final class ChildWindowHostView: UIView, WindowHost {
|
|||||||
var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)?
|
var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)?
|
||||||
var presentController: ((ContainableController, PresentationSurfaceLevel, Bool, @escaping () -> Void) -> Void)?
|
var presentController: ((ContainableController, PresentationSurfaceLevel, Bool, @escaping () -> Void) -> Void)?
|
||||||
var invalidateDeferScreenEdgeGestureImpl: (() -> Void)?
|
var invalidateDeferScreenEdgeGestureImpl: (() -> Void)?
|
||||||
var invalidatePreferNavigationUIHiddenImpl: (() -> Void)?
|
var invalidatePrefersOnScreenNavigationHiddenImpl: (() -> Void)?
|
||||||
var invalidateSupportedOrientationsImpl: (() -> Void)?
|
var invalidateSupportedOrientationsImpl: (() -> Void)?
|
||||||
var cancelInteractiveKeyboardGesturesImpl: (() -> Void)?
|
var cancelInteractiveKeyboardGesturesImpl: (() -> Void)?
|
||||||
var forEachControllerImpl: (((ContainableController) -> Void) -> Void)?
|
var forEachControllerImpl: (((ContainableController) -> Void) -> Void)?
|
||||||
@@ -35,8 +35,8 @@ private final class ChildWindowHostView: UIView, WindowHost {
|
|||||||
self.invalidateDeferScreenEdgeGestureImpl?()
|
self.invalidateDeferScreenEdgeGestureImpl?()
|
||||||
}
|
}
|
||||||
|
|
||||||
func invalidatePreferNavigationUIHidden() {
|
func invalidatePrefersOnScreenNavigationHidden() {
|
||||||
self.invalidatePreferNavigationUIHiddenImpl?()
|
self.invalidatePrefersOnScreenNavigationHiddenImpl?()
|
||||||
}
|
}
|
||||||
|
|
||||||
func invalidateSupportedOrientations() {
|
func invalidateSupportedOrientations() {
|
||||||
@@ -67,7 +67,7 @@ public func childWindowHostView(parent: UIView) -> WindowHostView {
|
|||||||
return false
|
return false
|
||||||
}, updateSupportedInterfaceOrientations: { orientations in
|
}, updateSupportedInterfaceOrientations: { orientations in
|
||||||
}, updateDeferScreenEdgeGestures: { edges in
|
}, updateDeferScreenEdgeGestures: { edges in
|
||||||
}, updatePreferNavigationUIHidden: { value in
|
}, updatePrefersOnScreenNavigationHidden: { value in
|
||||||
})
|
})
|
||||||
|
|
||||||
view.updateSize = { [weak hostView] size in
|
view.updateSize = { [weak hostView] size in
|
||||||
@@ -102,8 +102,8 @@ public func childWindowHostView(parent: UIView) -> WindowHostView {
|
|||||||
return hostView?.invalidateDeferScreenEdgeGesture?()
|
return hostView?.invalidateDeferScreenEdgeGesture?()
|
||||||
}
|
}
|
||||||
|
|
||||||
view.invalidatePreferNavigationUIHiddenImpl = { [weak hostView] in
|
view.invalidatePrefersOnScreenNavigationHiddenImpl = { [weak hostView] in
|
||||||
return hostView?.invalidatePreferNavigationUIHidden?()
|
return hostView?.invalidatePrefersOnScreenNavigationHidden?()
|
||||||
}
|
}
|
||||||
|
|
||||||
view.invalidateSupportedOrientationsImpl = { [weak hostView] in
|
view.invalidateSupportedOrientationsImpl = { [weak hostView] in
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var preferNavigationUIHidden: Bool = false {
|
var prefersOnScreenNavigationHidden: Bool = false {
|
||||||
didSet {
|
didSet {
|
||||||
if oldValue != self.preferNavigationUIHidden {
|
if oldValue != self.prefersOnScreenNavigationHidden {
|
||||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||||
self.setNeedsUpdateOfHomeIndicatorAutoHidden()
|
self.setNeedsUpdateOfHomeIndicatorAutoHidden()
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
override var prefersHomeIndicatorAutoHidden: Bool {
|
override var prefersHomeIndicatorAutoHidden: Bool {
|
||||||
return self.preferNavigationUIHidden
|
return self.prefersOnScreenNavigationHidden
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
||||||
@@ -226,7 +226,7 @@ private final class NativeWindow: UIWindow, WindowHost {
|
|||||||
var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)?
|
var hitTestImpl: ((CGPoint, UIEvent?) -> UIView?)?
|
||||||
var presentNativeImpl: ((UIViewController) -> Void)?
|
var presentNativeImpl: ((UIViewController) -> Void)?
|
||||||
var invalidateDeferScreenEdgeGestureImpl: (() -> Void)?
|
var invalidateDeferScreenEdgeGestureImpl: (() -> Void)?
|
||||||
var invalidatePreferNavigationUIHiddenImpl: (() -> Void)?
|
var invalidatePrefersOnScreenNavigationHiddenImpl: (() -> Void)?
|
||||||
var invalidateSupportedOrientationsImpl: (() -> Void)?
|
var invalidateSupportedOrientationsImpl: (() -> Void)?
|
||||||
var cancelInteractiveKeyboardGesturesImpl: (() -> Void)?
|
var cancelInteractiveKeyboardGesturesImpl: (() -> Void)?
|
||||||
var forEachControllerImpl: (((ContainableController) -> Void) -> Void)?
|
var forEachControllerImpl: (((ContainableController) -> Void) -> Void)?
|
||||||
@@ -322,8 +322,8 @@ private final class NativeWindow: UIWindow, WindowHost {
|
|||||||
self.invalidateDeferScreenEdgeGestureImpl?()
|
self.invalidateDeferScreenEdgeGestureImpl?()
|
||||||
}
|
}
|
||||||
|
|
||||||
func invalidatePreferNavigationUIHidden() {
|
func invalidatePrefersOnScreenNavigationHidden() {
|
||||||
self.invalidatePreferNavigationUIHiddenImpl?()
|
self.invalidatePrefersOnScreenNavigationHiddenImpl?()
|
||||||
}
|
}
|
||||||
|
|
||||||
func invalidateSupportedOrientations() {
|
func invalidateSupportedOrientations() {
|
||||||
@@ -363,8 +363,8 @@ public func nativeWindowHostView() -> (UIWindow & WindowHost, WindowHostView, UI
|
|||||||
rootViewController.orientations = orientations
|
rootViewController.orientations = orientations
|
||||||
}, updateDeferScreenEdgeGestures: { edges in
|
}, updateDeferScreenEdgeGestures: { edges in
|
||||||
rootViewController.gestureEdges = edges
|
rootViewController.gestureEdges = edges
|
||||||
}, updatePreferNavigationUIHidden: { value in
|
}, updatePrefersOnScreenNavigationHidden: { value in
|
||||||
rootViewController.preferNavigationUIHidden = value
|
rootViewController.prefersOnScreenNavigationHidden = value
|
||||||
})
|
})
|
||||||
|
|
||||||
rootViewController.transitionToSize = { [weak hostView] size, duration in
|
rootViewController.transitionToSize = { [weak hostView] size, duration in
|
||||||
@@ -406,8 +406,8 @@ public func nativeWindowHostView() -> (UIWindow & WindowHost, WindowHostView, UI
|
|||||||
return hostView?.invalidateDeferScreenEdgeGesture?()
|
return hostView?.invalidateDeferScreenEdgeGesture?()
|
||||||
}
|
}
|
||||||
|
|
||||||
window.invalidatePreferNavigationUIHiddenImpl = { [weak hostView] in
|
window.invalidatePrefersOnScreenNavigationHiddenImpl = { [weak hostView] in
|
||||||
return hostView?.invalidatePreferNavigationUIHidden?()
|
return hostView?.invalidatePrefersOnScreenNavigationHidden?()
|
||||||
}
|
}
|
||||||
|
|
||||||
window.invalidateSupportedOrientationsImpl = { [weak hostView] in
|
window.invalidateSupportedOrientationsImpl = { [weak hostView] in
|
||||||
|
|||||||
@@ -445,4 +445,16 @@ public final class PresentationContext {
|
|||||||
|
|
||||||
return edges
|
return edges
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func combinedPrefersOnScreenNavigationHidden() -> Bool {
|
||||||
|
var hidden: Bool = false
|
||||||
|
|
||||||
|
for (controller, _) in self.controllers {
|
||||||
|
if let controller = controller as? ViewController {
|
||||||
|
hidden = hidden || controller.prefersOnScreenNavigationHidden
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hidden
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ private final class TabBarNodeContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
item.removeSetBadgeListener(self.updateBadgeListenerIndex)
|
self.item.removeSetBadgeListener(self.updateBadgeListenerIndex)
|
||||||
item.removeSetTitleListener(self.updateTitleListenerIndex)
|
self.item.removeSetTitleListener(self.updateTitleListenerIndex)
|
||||||
item.removeSetImageListener(self.updateImageListenerIndex)
|
self.item.removeSetImageListener(self.updateImageListenerIndex)
|
||||||
item.removeSetSelectedImageListener(self.updateSelectedImageListenerIndex)
|
self.item.removeSetSelectedImageListener(self.updateSelectedImageListenerIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,16 +110,16 @@ public enum ViewControllerNavigationPresentation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final var preferNavigationUIHidden: Bool = false {
|
public final var prefersOnScreenNavigationHidden: Bool = false {
|
||||||
didSet {
|
didSet {
|
||||||
if self.preferNavigationUIHidden != oldValue {
|
if self.prefersOnScreenNavigationHidden != oldValue {
|
||||||
self.window?.invalidatePreferNavigationUIHidden()
|
self.window?.invalidatePrefersOnScreenNavigationHidden()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override open var prefersHomeIndicatorAutoHidden: Bool {
|
override open var prefersHomeIndicatorAutoHidden: Bool {
|
||||||
return self.preferNavigationUIHidden
|
return self.prefersOnScreenNavigationHidden
|
||||||
}
|
}
|
||||||
|
|
||||||
open var navigationPresentation: ViewControllerNavigationPresentation = .default
|
open var navigationPresentation: ViewControllerNavigationPresentation = .default
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public final class WindowHostView {
|
|||||||
|
|
||||||
let updateSupportedInterfaceOrientations: (UIInterfaceOrientationMask) -> Void
|
let updateSupportedInterfaceOrientations: (UIInterfaceOrientationMask) -> Void
|
||||||
let updateDeferScreenEdgeGestures: (UIRectEdge) -> Void
|
let updateDeferScreenEdgeGestures: (UIRectEdge) -> Void
|
||||||
let updatePreferNavigationUIHidden: (Bool) -> Void
|
let updatePrefersOnScreenNavigationHidden: (Bool) -> Void
|
||||||
|
|
||||||
var present: ((ContainableController, PresentationSurfaceLevel, Bool, @escaping () -> Void) -> Void)?
|
var present: ((ContainableController, PresentationSurfaceLevel, Bool, @escaping () -> Void) -> Void)?
|
||||||
var presentInGlobalOverlay: ((_ controller: ContainableController) -> Void)?
|
var presentInGlobalOverlay: ((_ controller: ContainableController) -> Void)?
|
||||||
@@ -215,20 +215,20 @@ public final class WindowHostView {
|
|||||||
var isUpdatingOrientationLayout = false
|
var isUpdatingOrientationLayout = false
|
||||||
var hitTest: ((CGPoint, UIEvent?) -> UIView?)?
|
var hitTest: ((CGPoint, UIEvent?) -> UIView?)?
|
||||||
var invalidateDeferScreenEdgeGesture: (() -> Void)?
|
var invalidateDeferScreenEdgeGesture: (() -> Void)?
|
||||||
var invalidatePreferNavigationUIHidden: (() -> Void)?
|
var invalidatePrefersOnScreenNavigationHidden: (() -> Void)?
|
||||||
var invalidateSupportedOrientations: (() -> Void)?
|
var invalidateSupportedOrientations: (() -> Void)?
|
||||||
var cancelInteractiveKeyboardGestures: (() -> Void)?
|
var cancelInteractiveKeyboardGestures: (() -> Void)?
|
||||||
var forEachController: (((ContainableController) -> Void) -> Void)?
|
var forEachController: (((ContainableController) -> Void) -> Void)?
|
||||||
var getAccessibilityElements: (() -> [Any]?)?
|
var getAccessibilityElements: (() -> [Any]?)?
|
||||||
|
|
||||||
init(containerView: UIView, eventView: UIView, aboveStatusBarView: UIView, isRotating: @escaping () -> Bool, updateSupportedInterfaceOrientations: @escaping (UIInterfaceOrientationMask) -> Void, updateDeferScreenEdgeGestures: @escaping (UIRectEdge) -> Void, updatePreferNavigationUIHidden: @escaping (Bool) -> Void) {
|
init(containerView: UIView, eventView: UIView, aboveStatusBarView: UIView, isRotating: @escaping () -> Bool, updateSupportedInterfaceOrientations: @escaping (UIInterfaceOrientationMask) -> Void, updateDeferScreenEdgeGestures: @escaping (UIRectEdge) -> Void, updatePrefersOnScreenNavigationHidden: @escaping (Bool) -> Void) {
|
||||||
self.containerView = containerView
|
self.containerView = containerView
|
||||||
self.eventView = eventView
|
self.eventView = eventView
|
||||||
self.aboveStatusBarView = aboveStatusBarView
|
self.aboveStatusBarView = aboveStatusBarView
|
||||||
self.isRotating = isRotating
|
self.isRotating = isRotating
|
||||||
self.updateSupportedInterfaceOrientations = updateSupportedInterfaceOrientations
|
self.updateSupportedInterfaceOrientations = updateSupportedInterfaceOrientations
|
||||||
self.updateDeferScreenEdgeGestures = updateDeferScreenEdgeGestures
|
self.updateDeferScreenEdgeGestures = updateDeferScreenEdgeGestures
|
||||||
self.updatePreferNavigationUIHidden = updatePreferNavigationUIHidden
|
self.updatePrefersOnScreenNavigationHidden = updatePrefersOnScreenNavigationHidden
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate var onScreenNavigationHeight: CGFloat? {
|
fileprivate var onScreenNavigationHeight: CGFloat? {
|
||||||
@@ -250,7 +250,7 @@ public protocol WindowHost {
|
|||||||
func present(_ controller: ContainableController, on level: PresentationSurfaceLevel, blockInteraction: Bool, completion: @escaping () -> Void)
|
func present(_ controller: ContainableController, on level: PresentationSurfaceLevel, blockInteraction: Bool, completion: @escaping () -> Void)
|
||||||
func presentInGlobalOverlay(_ controller: ContainableController)
|
func presentInGlobalOverlay(_ controller: ContainableController)
|
||||||
func invalidateDeferScreenEdgeGestures()
|
func invalidateDeferScreenEdgeGestures()
|
||||||
func invalidatePreferNavigationUIHidden()
|
func invalidatePrefersOnScreenNavigationHidden()
|
||||||
func invalidateSupportedOrientations()
|
func invalidateSupportedOrientations()
|
||||||
func cancelInteractiveKeyboardGestures()
|
func cancelInteractiveKeyboardGestures()
|
||||||
}
|
}
|
||||||
@@ -299,7 +299,7 @@ public class Window1 {
|
|||||||
|
|
||||||
private var tracingStatusBarsInvalidated = false
|
private var tracingStatusBarsInvalidated = false
|
||||||
private var shouldUpdateDeferScreenEdgeGestures = false
|
private var shouldUpdateDeferScreenEdgeGestures = false
|
||||||
private var shouldInvalidatePreferNavigationUIHidden = false
|
private var shouldInvalidatePrefersOnScreenNavigationHidden = false
|
||||||
private var shouldInvalidateSupportedOrientations = false
|
private var shouldInvalidateSupportedOrientations = false
|
||||||
|
|
||||||
private var statusBarHidden = false
|
private var statusBarHidden = false
|
||||||
@@ -405,8 +405,8 @@ public class Window1 {
|
|||||||
self?.invalidateDeferScreenEdgeGestures()
|
self?.invalidateDeferScreenEdgeGestures()
|
||||||
}
|
}
|
||||||
|
|
||||||
self.hostView.invalidatePreferNavigationUIHidden = { [weak self] in
|
self.hostView.invalidatePrefersOnScreenNavigationHidden = { [weak self] in
|
||||||
self?.invalidatePreferNavigationUIHidden()
|
self?.invalidatePrefersOnScreenNavigationHidden()
|
||||||
}
|
}
|
||||||
|
|
||||||
self.hostView.invalidateSupportedOrientations = { [weak self] in
|
self.hostView.invalidateSupportedOrientations = { [weak self] in
|
||||||
@@ -613,8 +613,8 @@ public class Window1 {
|
|||||||
self.hostView.eventView.setNeedsLayout()
|
self.hostView.eventView.setNeedsLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func invalidatePreferNavigationUIHidden() {
|
public func invalidatePrefersOnScreenNavigationHidden() {
|
||||||
self.shouldInvalidatePreferNavigationUIHidden = true
|
self.shouldInvalidatePrefersOnScreenNavigationHidden = true
|
||||||
self.hostView.eventView.setNeedsLayout()
|
self.hostView.eventView.setNeedsLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -831,17 +831,17 @@ public class Window1 {
|
|||||||
self.hostView.updateSupportedInterfaceOrientations(resolvedOrientations)
|
self.hostView.updateSupportedInterfaceOrientations(resolvedOrientations)
|
||||||
|
|
||||||
self.hostView.updateDeferScreenEdgeGestures(self.collectScreenEdgeGestures())
|
self.hostView.updateDeferScreenEdgeGestures(self.collectScreenEdgeGestures())
|
||||||
self.hostView.updatePreferNavigationUIHidden(self.collectPreferNavigationUIHidden())
|
self.hostView.updatePrefersOnScreenNavigationHidden(self.collectPrefersOnScreenNavigationHidden())
|
||||||
|
|
||||||
self.shouldUpdateDeferScreenEdgeGestures = false
|
self.shouldUpdateDeferScreenEdgeGestures = false
|
||||||
self.shouldInvalidatePreferNavigationUIHidden = false
|
self.shouldInvalidatePrefersOnScreenNavigationHidden = false
|
||||||
self.shouldInvalidateSupportedOrientations = false
|
self.shouldInvalidateSupportedOrientations = false
|
||||||
} else if self.shouldUpdateDeferScreenEdgeGestures || self.shouldInvalidatePreferNavigationUIHidden || self.shouldInvalidateSupportedOrientations {
|
} else if self.shouldUpdateDeferScreenEdgeGestures || self.shouldInvalidatePrefersOnScreenNavigationHidden || self.shouldInvalidateSupportedOrientations {
|
||||||
self.hostView.updateDeferScreenEdgeGestures(self.collectScreenEdgeGestures())
|
self.hostView.updateDeferScreenEdgeGestures(self.collectScreenEdgeGestures())
|
||||||
self.hostView.updatePreferNavigationUIHidden(self.collectPreferNavigationUIHidden())
|
self.hostView.updatePrefersOnScreenNavigationHidden(self.collectPrefersOnScreenNavigationHidden())
|
||||||
|
|
||||||
self.shouldUpdateDeferScreenEdgeGestures = false
|
self.shouldUpdateDeferScreenEdgeGestures = false
|
||||||
self.shouldInvalidatePreferNavigationUIHidden = false
|
self.shouldInvalidatePrefersOnScreenNavigationHidden = false
|
||||||
|
|
||||||
if self.shouldInvalidateSupportedOrientations {
|
if self.shouldInvalidateSupportedOrientations {
|
||||||
var supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .all)
|
var supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .all)
|
||||||
@@ -1126,8 +1126,16 @@ public class Window1 {
|
|||||||
return edges
|
return edges
|
||||||
}
|
}
|
||||||
|
|
||||||
private func collectPreferNavigationUIHidden() -> Bool {
|
private func collectPrefersOnScreenNavigationHidden() -> Bool {
|
||||||
return false
|
var hidden = self.presentationContext.combinedPrefersOnScreenNavigationHidden()
|
||||||
|
|
||||||
|
for controller in self.topLevelOverlayControllers {
|
||||||
|
if let controller = controller as? ViewController {
|
||||||
|
hidden = hidden || controller.prefersOnScreenNavigationHidden
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
public func forEachViewController(_ f: (ContainableController) -> Bool) {
|
public func forEachViewController(_ f: (ContainableController) -> Bool) {
|
||||||
|
|||||||
@@ -837,6 +837,10 @@ public class GalleryController: ViewController {
|
|||||||
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.galleryNode.controlsVisibilityChanged = { [weak self] visible in
|
||||||
|
self?.prefersOnScreenNavigationHidden = !visible
|
||||||
|
}
|
||||||
|
|
||||||
let baseNavigationController = self.baseNavigationController
|
let baseNavigationController = self.baseNavigationController
|
||||||
self.galleryNode.baseNavigationController = { [weak baseNavigationController] in
|
self.galleryNode.baseNavigationController = { [weak baseNavigationController] in
|
||||||
return baseNavigationController
|
return baseNavigationController
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
|
|||||||
private var isDismissed = false
|
private var isDismissed = false
|
||||||
|
|
||||||
public var areControlsHidden = false
|
public var areControlsHidden = false
|
||||||
|
public var controlsVisibilityChanged: ((Bool) -> Void)?
|
||||||
|
|
||||||
public var isBackgroundExtendedOverNavigationBar = true {
|
public var isBackgroundExtendedOverNavigationBar = true {
|
||||||
didSet {
|
didSet {
|
||||||
if let (navigationBarHeight, layout) = self.containerLayout {
|
if let (navigationBarHeight, layout) = self.containerLayout {
|
||||||
@@ -268,6 +270,7 @@ open class GalleryControllerNode: ASDisplayNode, UIScrollViewDelegate, UIGesture
|
|||||||
|
|
||||||
open func setControlsHidden(_ hidden: Bool, animated: Bool) {
|
open func setControlsHidden(_ hidden: Bool, animated: Bool) {
|
||||||
self.areControlsHidden = hidden
|
self.areControlsHidden = hidden
|
||||||
|
self.controlsVisibilityChanged?(!hidden)
|
||||||
if animated {
|
if animated {
|
||||||
UIView.animate(withDuration: 0.3, animations: {
|
UIView.animate(withDuration: 0.3, animations: {
|
||||||
let alpha: CGFloat = self.areControlsHidden ? 0.0 : 1.0
|
let alpha: CGFloat = self.areControlsHidden ? 0.0 : 1.0
|
||||||
|
|||||||
Reference in New Issue
Block a user