I see that in iOS 9 setStatusBarHidden(_:withAnimation:)
is now deprecated and the documentation says to use [UIViewController prefersStatusBarHidden]
instead but what is the alternative in iOS 9 if I still want to hide the status bar with a slide animation?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
Hey guys, found a much neater way of going about it for Swift 3, by using a private var pairing with each of the overrides. My original post: https://stackoverflow.com/a/42083459/7183483
but here's the jist of it:
Here's a snippet:
which I then could call in a function like so: (this is one of my examples, so disregard the custom function).
I have cleaned up Leo's amazing answer a bit by moving the update to
didSet
(Swift 3 syntax).if you are coding with objective c, Here is the solution :)(Leo's Objective C version :P thanks man!!!)
declare a variable
and then add this code when you want to hide status bar
after that add this two method
Hope your problem will be solve (smile)
Swift 3
Refer to
preferredStatusBarUpdateAnimation
,Gif
Code