Swift/iOS beginner

Principles for learning swift and swiftUI

Its never been easier to develop Apple applications if we follow these rules:

  1. Use Swift and SwiftUI

  2. Use modern Xcode

  3. Avoid UIKit


Learning swift programming is not so easy but beginners have new things to make it easy:

  1. Swift is awesome and has a bright future that protects the investment we make to learn it

  2. The Swift Guide is awesome: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html

  3. Apple's Playgrounds app makes it easy to get started learning Swift

  4. Head First Swift book https://learning.oreilly.com/library/view/head-first-swift/9781491923184/


Learning SwiftUI is easy on a modern Mac with modern Xcode:

  1. Have modern Xcode and learn here: https://developer.apple.com/tutorials/sample-apps/

  2. Xcode code-completion and error detection represents the ultimate training wheels in all of programming


Details for learning swift and swiftUI

Lets go over each of these principles, one by one:

Use Swift and SwiftUI: The future of Apple programming is embodied by these two technologies. Much has been said about Swift and SwiftUI but the most important thing is usually left unsaid: programming in Swift and building interfaces with SwiftUI can be very easy to learn, easy to do, and fun.

Use modern Xcode: Xcode is a most powerful code IDE, too powerful in most cases. Its very easy to drown oneself in a nightmare using Xcode. Whether we drown or not depends totally on the code we write. If we leave all of the UI to SwiftUI and let Apple libraries do all of the heavy lifting with our data, then our Xcode experience will be a breeze. When the going gets tough, we look at our code, not at Xcode.

Avoid UIKit: The percentage of apps that can be built without UIKit grows everyday. If your Swift code has a line that reads "import UIKit" at the top, then you can stop reading right now. Learning to use UIKit is not easy. Learning SwiftUI takes 100x less time to learn, uses 100x fewer lines of code, keeps our friendship with Xcode healthy. UIKit is awesome, for sure, and we would need it to create a pinball-style game app. If you think you need UIKit, double and triple-check that. The rule here is simple and most important: never use UIKit, never say "import UIKit".

Swift is awesome and has a bright future that protects the investment we make to learn it: Swift has combined many of the best things we find in modern programming languages. Most people will use Swift to create Apple apps, but Swift can do network programming, server-side programming, machine learning, concurrency, nearly anything. High quality libraries let us forget about most of the code we write.

The Swift Guide is awesome: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html: The Guide is a great reference that we consult when programming. Which Swift book is best depends heavily on programmer experience. The Swift Guide is the bible.

Apple's Playgrounds app makes it easy to get started learning Swift: Learning Swift begins with two things: reading code and writing code. Everyone should use only Playgrounds to learn Swift programming. Stay out of Xcode, the deep end of the pool, until you can swim comfortably in Playgrounds.

Head First Swift book https://learning.oreilly.com/library/view/head-first-swift/9781491923184/: O'Reilly's Head First books generally assume a beginner audience. Head First Swift gives beginners efficient learning from zero to iOS app.

Have modern Xcode and learn here: https://developer.apple.com/tutorials/sample-apps/: Apple drops tons of awesome little SwiftUI apps right here and they run in Playgrounds where we see our code and see the UI displayed as we tweak the code.

Xcode code-completion and error detection represents the ultimate training wheels in all of programming: Playgrounds is for training. Xcode is for coding. Xcode constantly and promptly shows the programmer errors, offers code-completion and has an avalanche of tools to analyze code and improve performance. We want to have recent versions of Mac OS X and Xcode.