Add a UIView above all, even the navigation bar

I want to display, above any other views, even the navigation bar, a kind of “pop-up” view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some information, (a calendar if you want to know everything). To do that, … Read more

How to set Status Bar Style in Swift 3

I’m using Xcode 8.0 beta 4. In previous version, UIViewController have method to set the status bar style public func preferredStatusBarStyle() -> UIStatusBarStyle However, I found it changed to a “Get ONLY varaiable” in Swift 3. public var preferredStatusBarStyle: UIStatusBarStyle { get } How can provide the style to use in my UIViewController? 33 Answers … Read more

Disable the interactive dismissal of presented view controller

iOS 13 introduces a new design of modalPresentationStyle .pageSheet (and its sibling .formSheet) for modally presented view controllers… …and we can dismiss these sheets by sliding the presented view controller down (interactive dismissal). Although the new “pull-to-dismiss” feature is pretty useful, it may not always be desirable. THE QUESTION: How can we turn the interactive … Read more

Changing the Status Bar Color for specific ViewControllers using Swift in iOS8

override func preferredStatusBarStyle() -> UIStatusBarStyle { return UIStatusBarStyle.LightContent; } Using the above code in any ViewController to set the statusBar color to White for a specific viewcontroller doesnt work in iOS8 for me. Any suggestions? Using the UIApplication.sharedApplication method, the color changes after required changes in the Info.plist for the whole app. // Change the … Read more

Get top most UIViewController

I can’t seem to get the top most UIViewController without access to a UINavigationController. Here is what I have so far: UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(vc, animated: true, completion: nil) However, it does not seem to do anything. The keyWindow and rootViewController seem to be non-nil values too, so the optional chaining shouldn’t be an issue. NOTE: It is … Read more

Explaining difference between automaticallyAdjustsScrollViewInsets, extendedLayoutIncludesOpaqueBars, edgesForExtendedLayout in iOS7

I have been reading a lot about iOS7 UI transition. I am not able to get what these three properties automaticallyAdjustsScrollViewInsets, extendedLayoutIncludesOpaqueBars, edgesForExtendedLayout?? For example I am trying to make my view controllers start below the status bar but I am not able to achieve it. 5 Answers 5