Using the following line of code in my project I am able to programmatically add buttons to a UINavigationViewController:
modalView.navigationItem.rightBarButtonItems = buttons;
This works well in the builds of my app after 5.0, but I want to support 4.3 as well. The rightBarButtonItems is only supported after 5.0.
I’ve searched the documentation, but am unable to find an equivalent function that 4.3 can support programmatically.
Welcome to suggestions or resources for this capability.
The closest equivalent is
rightBarButtonItem. To assign multiple buttons torightBarButtonItem, you have two options:Use a segmented control (I believe that is what Apple used e.g. in Mail.app for the arrow buttons to jump from message to message) and wrap the segmented control inside a
UIBarButtonItemwithinitWithCustomView:.Create multiple buttons, wrap them in a transparent container view, and create a single
UIBarButtonItemwith this container view (again withinitWithCustomView:).