I'm trying to add a UISegmentedControl to a UIToolbar using IB within xCode.
Whilst this is easy using a xib file, (create a view, add a toolbar to the bottom of the screen and drag on a UISegmentedControl onto the toolbar), it seems 'impossible' using storyboards.
I have a UIViewController scene embedded in a UINavigationController...
I have the following settings on the NavigationController...
I seem to be able to add UIBarButtonItems to the toolbar in the ViewController, not a UISegmentedControl as I can with xibs.
It even seems impossible to do via code...
let segmentControl = UISegmentedControl(items: ["One","Two"]);
let segmentedControlButtonItem = UIBarButtonItem(customView: segmentControl);
let barArray = [segmentedControlButtonItem];
self.navigationController?.setToolbarItems(barArray, animated: false);
Surely this is doable via storyboards? I can add UISegmentControls to the top bar in the Navigation Controller, (via a UIView) but not to the bottom toolbar.
How can this be done?