Now that all of our files and images are added, we can start building our storyboard and apply Auto Layout constraints. Open
Main.storyboard and we should see an empty view controller assigned to our
Our menu will be made up of four separate components. Let's start by adding the first three to our storyboard file (the fourth will be created programmatically). Open the Xcode Utilities pane (if it is not already open) and select the object library at the bottom of the view.
First, drag one
UIImageView class onto our
MenuViewController making sure it is sized to fit the entire view. Next, drag two
UIButtons on top of the
UIImageView without worrying about their position. In our Utilities pane, select the Attributes Inspector, and then select one of the two buttons. Erase the Default Title option so that it is blank. Next, click on the drop-down menu for Image and select
foodButton as our image. Xcode will automatically resize
UIButton to the...