FREE TRIAL: Accelerate your app development career with Hacking with Swift+! >>

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!

 

Hacking with Swift is sponsored by Essential Developer

SPONSORED From August 2nd to 8th you can join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer!

Save your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

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.