My current project has a UITabBarController and in the UIViewController I have a ScrollView and inside that I have a Stack View.
The new default behaviour for the UITabBarController is to be pinned to the screen and allow the content to scroll underneath it.
But you are able to set an instance property to allow the tab bar to scroll away with the content as you navigate down.
I'm trying to set the instance property tabBarObservedScrollView
in the viewWillAppear
of the viewController as mentioned in the WWDC video at min 38 here: https://developer.apple.com/videos/play/wwdc2019/211/
But the problem I'm getting is that it doesn't scroll away. I've put a sample application together in GitHub so I can share it here to see if I'm doing something wrong.
If anyone has come across this issue already I'd be pleased to know how to fix it. Thanks :-)
https://github.com/kyazdani/TVTabBarScrollAway
You need to set tabBarObservedScrollView on the actual view controller that is part of the array of view controllers that the UITabBarController handles.
In your example code you set it on the scroll view, but it's your UINavigationController that the UITabBarController manages, you need to set it there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With