The short answer is, you do not.
You have two UIToolbar and some code that moves the contents of one to the other when the UISplitViewController calls its delegate
β splitViewController:willHideViewController:withBarButtonItem:forPopoverController:
which moves items back to
β splitViewController:willShowViewController:invalidatingBarButtonItem:
method.
For example, this might work:
β splitViewController:willHideViewController:withBarButtonItem:forPopoverController: { // β¦ NSArray *leftItems = leftBar.items; rightBar.items = [leftItems arrayByAddingObjectsFromArray:rightBar.items]; leftBar.hidden=YES; // β¦ } β splitViewController:willShowViewController:invalidatingBarButtonItem: { // β¦ NSArray *rightItems = rightBar.items; NSUInteger lc = [leftBar.items count]; rightBar.items = [rightItems subArrayWithRange:NSMakeRange(lc,[rightItems count] - lc)]; leftBar.hidden=NO; // β¦ }
source share