In the next couple of days, the 8th edition of iOS Apprentice — a great book for beginners who want to learn how to write iOS apps — will be available. I learned iOS programming from an earlier version, and fittingly enough, I wrote the first two sections of the upcoming edition.
In my sections, I show you how to write apps using SwiftUI, the new declarative Swift-based way of defining user interfaces for iOS and other Apple operating systems. This required me to not just revise the previous edition, but to rewrite my sections nearly from scratch. It was a lot of work, but it was enjoyable work, and I’m quite pleased with the results.
If you’d like a taste of what my section of the book is like, check out these sample videos from the RayWenderlich.com course called Your first iOS and SwiftUI app. It’s based on some of my chapters from iOS Apprentice, where you learn how to write your first app: a simple game called Bullseye. You can access the whole course with a subscription, which is a worthwhile investment.
And now, the sample videos…
Your First Programming Challenge: Making a Programming To-Do List
The course starts with a challenge: given a description of the game you’re about to develop, make a to-do list of tasks that you, as the programmer, will have to perform in order to have a completed app.
Getting Started with SwiftUI
Now that you’ve go a to-do list, it’s time to build your first Swift and SwiftUI app — an app that displays a button.
Objects, Data and Methods
Now that you’ve created your first app, you’ll need to learn a little programming theory and how it relates to the code behind the app.
Buttons and Actions
At this point, the app displays a button on the screen, but nothing happens when you press it. Let’s fix that.
Swift UI State
State is a key part of programming with SwiftUI. In this section, Ray introduces the concept of state and how it relates to how the SwiftUI draws the user interface.
Solving Code Problems
One of the biggest pitfalls when learning iOS development when something goes wrong. Here’s how you deal with these situations.
Portrait vs Landscape
In this section, you’ll learn about portrait and landscape modes, iDevice screen resolutions, and setting up the app so that it displays its content in landscape mode only.
Swift UI Views
This covers views, which are anything that’s drawn on the screen.
Swift UI Layout
You’ll learn the basic of laying out user interface elements on the app’s screens in this section.
Spacers and Padding
Cluttered interfaces aren’t as usable, so here come spacers and padding to the rescue!
Once again, you can watch the entire course (plus every other course and tutorial at RayWenderlich.com) with a subscription, and you can get this tutorial in book form soon when the book i co-wrote — iOS Apprentice, 8th edition — comes out in just a few days!