hidesBottomBarWhenPushed is ignored for state restoration

Originator:marcin.krzyzanowski
Number:rdar://31474335 Date Originated:06-Apr-2017
Status:Open Resolved:
Product:OS + SDK Product Version:10.3
Classification: Reproducible:Always
 
Area:
UIKit

Summary:
-[UIViewController hidesBottomBarWhenPushed] property value is ignored when the view is restored during the app state restoration flow.

During the restoration, UINavigationController checks the value of the hidesBottomBarWhenPushed property (see attached screenshot) although the bottom bar is not hidden unless pop/push operation is called.

The workaround is to hide the toolbar in the decodeRestorableStateWithCoder method

- (void)decodeRestorableStateWithCoder:(NSCoder *)coder {
    [super decodeRestorableStateWithCoder:coder];
    [self.navigationController setToolbarHidden:self.hidesBottomBarWhenPushed animated:NO];
}

Steps to Reproduce:
1. Create empty app with the toolbar
2. Add UIViewController inside UINavigationController.
3. Set the value of -[UIViewController hidesBottomBarWhenPushed] = YES
4. Preserve app state with the UIViewController on the top
5. Restore the app state

Expected Results:
The toolbar is hidden

Actual Results:
The toolbar is not hidden

Version:
iOS 10.3.1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!