Site icon Vineet Geek

How to make an iOS app for beginners in 5 simple steps | Part-2

data codes through eyeglasses

Photo by Kevin Ku on Pexels.com

What You Will Create

We’re going to make a Magic 8 Ball app. You can ask the app to make all your difficult decisions. Should I order a Beef burrito or a Pepperoni Pizza with extra cheese? Should I watch Stranger Things or Game of Thrones? With this app in your pocket, you’ll always have an answer to life’s many conundrums!

Step 1: Design the User Interface

First, take a look around the project. Familiarise yourself with what’s been included in the starting project. We’ve already added the required image assets and the app icons. Everything else has been left for you to complete.

Hint: Try messing with properties in the Attribute inspector with the View selected in the Document Outline.

See the screenshot below if you’re confused about where these things are.

Next, let’s add all the UI elements on to our canvas.

Feel free to tweak the Font Style and Font Sizes to your liking. You should end up with something like this:

You can ignore any yellow warnings at this stage.

Also Read: https://www.vineetgeek.in/xcode-sideloading-troubleshooting/

Step 2: Link Up the Design with Code

Open up the Assistant Editor so that the screen is split in two showing the design file and the code file side-by-side.

Hint: Remember to hold down the control key

GOAL

Step 3: Use Code to Change the 8 Ball Image

Hint: 1. There are a total of 5 ball images. You can find them in the Assets.xcassets folder.

Step 4: Make the Ball Image Random

Hint 1: You can generate a random integer (whole number) between x and y with the code:

Step 5: Show off your work!

Feel free to customise the app to your liking, change the images, change the title. Make it your own then show it off in the comments section below this lesson!

Also you can clone it directly from github: https://github.com/vineetgeek/askmeanything_iOS

Exit mobile version