BLACK FRIDAY: Save 50% on all our Swift books and bundles! >>

DAY 37

Project 8, part two


How did you get on with yesterday’s user interface coding? After you completed the topics, there was one thing I asked you to keep in mind: whether you prefer making user interfaces in storyboards or programmatically, it’s important you know how to do both. Now that you’ve done both, how do you feel about it?

This isn’t just a theoretical question – if you’re anything like me, it’s a question you’ll get asked a lot, so it’s important to think carefully about your answer.

As for me, my answer is pretty simple: I do whatever makes sense in each individual scenario. Sometimes that means using code, sometimes it means using Interface Builder, and sometimes it means using both – and that’s OK. The main thing is that you remember the words of John Woods: “always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.”

Whether that’s making your UI in storyboards or in code is academic, really – what matters is that it was the best choice you could make for that problem, given the constraints you were working in.

You’ll be glad to see yesterday’s hard work pay off today, because we’ll be completing our game in under an hour of work. We laid all the foundations yesterday, so today we’ll be looking at loading levels and responding to button taps – no more Auto Layout for the time being!

Today you have three topics to work through, and you’ll learn about adding targets to a button, separating and joining strings, hiding views, and more.

Need help? Tweet me @twostraws!

 

Save 50% in my Black Friday sale.

SAVE 50% This Black Friday all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

100 Days of Swift


The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.