Make 2 toolbar / footer buttons with a width of 50% with Swift / Storyboard

I am trying to display a title bar, an image, and then two buttons, almost as shown below. The main differences are that I want the two element buttons to be 50% wide, and each one to be solid color (occupying the entire bottom of the screen). I do not use the tab bar, because buttons are just about changing the image, not the entire view controller.

screenshot

While using the storyboard, I just got stuck on the buttons. I have them on the toolbar as toolbar items. Then I tried to set their width in the controller:

@IBOutlet weak var firstButton: UIBarButtonItem!
@IBOutlet weak var secondButton: UIBarButtonItem!

override func viewDidLoad() {
    super.viewDidLoad()
    self.firstButton.width = self.view.bounds.width / 2
    self.secondButton.width = self.view.bounds.width / 2
}

screenshot

, , . , , , .

iOS, . , , , iPhone.

+4
3

, , . , .

:

. UIButtons.

  • ImageView 0,5
+3

Autolayout , SuperView 0,5

Superview Multiplier 1.0, UIButtons , 0.5

-

+6

All Articles