Weird uitableview behaviour in iOS11. Cells scroll up with navigation push animation

This is due to UIScrollView’s (UITableView is a subclass of UIScrollview) new contentInsetAdjustmentBehavior property, which is set to .automatic by default. You can override this behavior with the following snippet in the viewDidLoad of any affected controllers: tableView.contentInsetAdjustmentBehavior = .never https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior

SplitView like Facebook app on iPhone

Facebook guys have done brilliant job in the new version of the app. The similar open source code can be found from here – JTRevealSidebarDemo. Please note that as of June 2014, this project has been discontinued, so you’ll probably have better luck with a project from the list below. It reveals technique behind doing … Read more

UINavigationBar Hide back Button Text

In the interface builder, you can select the navigation item of the previous controller and change the Back Button string to what you’d like the back button to appear as. If you want it blank, for example, just put a space. You can also change it with this line of code: [self.navigationItem.backBarButtonItem setTitle:@”Title here”]; Or … Read more

Completion handler for UINavigationController “pushViewController:animated”?

See par’s answer for another and more up to date solution UINavigationController animations are run with CoreAnimation, so it would make sense to encapsulate the code within CATransaction and thus set a completion block. Swift: For swift I suggest creating an extension as such extension UINavigationController { public func pushViewController(viewController: UIViewController, animated: Bool, completion: @escaping … Read more

IOS7 : UIScrollView offset in UINavigationController

OK so i found the solution, I have set in my controller the property: self.automaticallyAdjustsScrollViewInsets = false I don’t really understand the true benefit of this property though, (or why the default value is true) The only documentation i found was there: https://web.archive.org/web/20160405135605/https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html https://developer.apple.com/documentation/uikit/uiviewcontroller/1621372-automaticallyadjustsscrollviewin Update In iOS 11 automaticallyAdjustsScrollViewInsets is deprecated You should now use: … Read more

UIRefreshControl – beginRefreshing not working when UITableViewController is inside UINavigationController

It seems that if you start refreshing programmatically, you have to scroll the table view yourself, say, by changing contentoffset [self.tableView setContentOffset:CGPointMake(0, -self.refreshControl.frame.size.height) animated:YES]; I would guess the reason for this is that it could be undesirable to scroll to the refresh control when user is in the middle/bottom of the table view? Swift 2.2 … Read more

How to get root view controller?

if you are trying to access the rootViewController you set in your appDelegate. try this: Objective-C YourViewController *rootController = (YourViewController*)[[(YourAppDelegate*) [[UIApplication sharedApplication]delegate] window] rootViewController]; Swift let appDelegate = UIApplication.sharedApplication().delegate as AppDelegate let viewController = appDelegate.window!.rootViewController as YourViewController Swift 3 let appDelegate = UIApplication.shared.delegate as! AppDelegate let viewController = appDelegate.window!.rootViewController as! YourViewController Swift 4 & 4.2 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)