uiviewcontroller
UIViewController -viewDidLoad not being called
RE: SOLUTION FOUND!!!!! Indeed that seems to be a working solution, however the real trick is not in setting the view.hidden property to NO, what makes the view load from the nib file is the calling of the UIViewController’s view method, the view only actually gets loaded from the nib when the view method is … Read more
iOS8 Interface Rotation Methods not called
The viewWillTransitionToSize:withTransitionCoordinator: seems to only work if the interface is actually going to change size, meaning we have rotated 90 degrees. If you have a mask on your layout that only allows landscape, when rotation 180 degrees, the interface size doesn’t change, so this method doesn’t seem to be called. I have worked around this … Read more
Remembering scroll position on UITableView
See here you have to first save the scrolled position of tableView i.e. contentOffset of tableView and then reuse it when you are coming back to tableView. 1)When and where you will save it : When : At the point, when you are drilling down to detailViewController save the contentOffset of tableView How : float … Read more
How to implement UIPageViewController that utilizes multiple ViewControllers
First of all, you are absolutely right that the view controllers that constitute the “pages” of the UIPageViewController can be completely different in nature. Nothing whatever says that they have to be instances of the same view controller class. Now let’s get to the actual problem, which is that you very sensibly need a way … Read more
Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?
I found a much better way that works independent of the nav controller. Right now, I have this working when embedded in a nav controller, and when NOT embedded (although I’m not using the nav controller right now, so there may be some bug I’ve not seen – e.g. the PUSH transition animation might go … Read more
presentingViewController is nil when using presentViewController:animated:completion: in iOS 8
Had a similar issue with iOS 8, where presentingController is nil when checking the value in viewDidLoad. When viewDidLoad is called, there is no guarantee that the view controller hierarchy is loaded in the navigation tree. Moving the logic to a later stage (for example: viewWillAppear) should resolve that issue as presentingController should be loaded … Read more
iOS 11 large title navigation bar snaps instead of smooth transition
I faced same issue – I had UIViewController embedded in UINavigationController, the UIViewController had tableview with leading, trailing, top, bottom constraints to safe area. The whole tableview behaved jumpy / snappy. The trick was to change top constraint of tableview to superview.
Order of UIViewController initialization and loading
The view loading system on the iPhone works like this: When you initialize a view controller (either with -init or -initWithNibName:bundle:), it doesn’t actually create and initialize the view. When you call -view for the first time, it calls -loadView. By default, -loadView just loads the view from the xib file (nibName). If you override … Read more
Swapping rootViewController with animation
transitionWithView is intended to animate subviews of the specified container view. It is not so simple to animate changing the root view controller. I’ve spent a long time trying to do it w/o side effects. See: Animate change of view controllers without using navigation controller stack, subviews or modal controllers? EDIT: added excerpt from referenced … Read more