setStatusBarHidden(_:withAnimation:) deprecated in iOS 9

Refer to preferredStatusBarUpdateAnimation, Gif Code class ViewController: UIViewController { var isHidden:Bool = false{ didSet{ UIView.animate(withDuration: 0.5) { () -> Void in self.setNeedsStatusBarAppearanceUpdate() } } } @IBAction func clicked(sender: AnyObject) { isHidden = !isHidden } override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation{ return .slide } override var prefersStatusBarHidden: Bool{ return isHidden } }

UITextView with hyperlink text

Set isEditable = false or the text view will go into text-editing mode when user taps on it. Swift 4 and later let attributedString = NSMutableAttributedString(string: “Just click here to register”) let url = URL(string: “https://www.apple.com”)! // Set the ‘click here’ substring to be the link attributedString.setAttributes([.link: url], range: NSMakeRange(5, 10)) self.textView.attributedText = attributedString self.textView.isUserInteractionEnabled … Read more

UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9

I think I have found a solution. I ended up setting the View controller-based status bar appearance boolean to NO In my info.plist file. Then I went to my target’s General settings -> Deployment info and changed the dropdown option Status Bar Style to Light instead of Default This changed the statusbar style to Light … Read more

setStatusBarHidden is deprecated in iOS 9.0

Add below code to your view controller.. – (BOOL)prefersStatusBarHidden { return NO; } Note : If you change the return value for this method, call the setNeedsStatusBarAppearanceUpdate method. For childViewController, To specify that a child view controller should control preferred status bar hidden/unhidden state, implement the childViewControllerForStatusBarHidden method.

How to reliably detect if an external keyboard is connected on iOS 9?

After going back to the original question, I’ve found a solution that works. It seems that when the regular virtual keyboard is displayed the keyboard frame is within the dimensions of the screen. However when a physical keyboard is connected and the keyboard toolbar is displayed, the keyboard frame is located offscreen. We can check … Read more

iOS 9 – “attempt to delete and reload the same index path”

This seems to be a bug in iOS 9 (which is still beta) and is also discussed in the Apple Developer Forum iOS 9 CoreData NSFetchedResultsController update causes blank rows in UICollectionView/UITableView I can confirm the problem with the iOS 9 Simulator from Xcode 7 beta 3. I observed that for an updated managed object, … Read more

xcodebuild -exportArchive: exportOptionsPlist error for key ‘method’: expected one of {}

I suspected xcodebuild tool initially, but it turned out the archive file was invaid. When I opened the archive file in Xcode and tried to export an ipa file manually, I noticed that “Upload to App Store” and “Validate” buttons were disabled. After clicking the “Export” button, it gave me two options: “Save Built Products” … Read more