HidingNavigationBar icon indicating copy to clipboard operation
HidingNavigationBar copied to clipboard

nav bar shows when app goes back to foreground

Open l12ab opened this issue 8 years ago • 1 comments

  1. scroll up hide nav bar
  2. press home button let app into background
  3. and then press again

oh, the nav bar appears, this is what i dont expected

l12ab avatar Oct 27 '16 15:10 l12ab

To fix this issue I added some logic to the default case for applicationWillEnterForeground. It expands or contracts the views based on the currentState.

func applicationWillEnterForeground() {
    switch onForegroundAction {
    case .show:
        _ = navBarController.expand()
        _ = tabBarController?.expand()
    case .hide:
        _ = navBarController.contract()
        _ = tabBarController?.contract()
    default:
        switch currentState {
        case .Open, .Expanding:
            _ = navBarController.expand()
            _ = tabBarController?.expand()
        case .Closed, .Contracting:
            _ = navBarController.contract()
            _ = tabBarController?.contract()
        }
    }
}

galvana avatar Nov 12 '16 06:11 galvana