Created
June 6, 2016 12:56
-
-
Save NSURLSession0/6aaf79fb4c2100471fb8744a9b974b3c to your computer and use it in GitHub Desktop.
tvOS detect tabbar show/hide in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) { | |
let prevFocusViewClassName = NSStringFromClass(context.previouslyFocusedView!.classForCoder) | |
let nextFocusedView = NSStringFromClass(context.nextFocusedView!.classForCoder) | |
let barButtonName = "UITabBarButton" | |
if prevFocusViewClassName == barButtonName && nextFocusedView != barButtonName { | |
// Tabbar disappeared | |
} else if prevFocusViewClassName != barButtonName && nextFocusedView == barButtonName { | |
// Tabbar appeared | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment