Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Large title crash application when view controller is opened for 2nd time in tab bar

I have a table bar root view controller set to navigation view controller with view controller that has only a table view in it.

When I set navigation bar large titles to always or automatic it will crash the app when I open tab 2nd time.

Error message is shown below:

Assertion failure in -[UITableView _addScrollViewScrollObserver:]*    
 Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
 reason: 'ERROR: UIScrollView does not support multiple observers implementing _scrollViewWillEndDraggingWithVelocity:targetContentOffset:'

I don't have idea how to fix it. Thank you in advance.

sotryboard screenshot

like image 239
thwKobas Avatar asked Nov 01 '17 11:11

thwKobas


2 Answers

Found it! Seems to be a bug with more than 1 Navigation controller in the stack.

So when my structure was (From top to bottom):

UINavigationController
UITabBarController 
UINavigationControllers (Different tab items)

If I removed to main NavigationController (Top), the exception is gone! Hope they will fix it soon.

like image 57
MCMatan Avatar answered Oct 08 '22 22:10

MCMatan


You should disable large titles for parent navigation controller (I guess you have more than one)

self.navigationBar.prefersLargeTitles = false
like image 45
Di B. Avatar answered Oct 08 '22 22:10

Di B.