i am unzipping a file on background thread and i am calling HomeViewController on main thread.in this view controller i have a UIBarButtonItem on UINavigationBar. if i click this button it goes to StoryViewController and the unzipped data is used there. so i want to show the Home view Controller though the unzipping process is not completed, for that i have to hide the button on the navigation bar when the unzipping starts on backround thread and after completion of the upzipping again i have to show the button on navigation bar. i am calling the methods of homeViewController to hide and show.. What i have to write in those methods..? i mean how to hide and show the uiBarButtonItem on UINavigationBar....?
Thanks....
Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.
Since UIBarButtonItems do not have a “hidden” property, we can't just set this to yes and it'll disappear. Instead, we can set them to nil.
Once you have created your UIBarButtonItem say "myButton", you can add/remove it to your navigation controller using in your view Controller:
if(show)
self.navigationItem.leftBarButtonItem = myButton;
else
self.navigationItem.leftBarButtonItem = nil;
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