SwiftUI

SwiftUI 101

November 24, 2019

SwiftUI is an awesome and pretty simple framework that Apple just released. It’s great because you can write so much code way faster than before. Unlike UIKit, another Swift framework, SwiftUI gets rid of storyboards and constraints, has a more declarative style, and makes it easier to avoid bugs. SwiftUI also introduced @State and @Binding variables, which are so cool. They allow you to let your UI stay in sync with your data, because any time an @State variable changes, the UI that depends on it gets updated automatically.

There are awesome new features like Previews, for example. In UIKit, you would need to run the app, wait for the simulator (an Xcode simulation of what your code would look like on a device) to show up and then you would be able to see your app’s design. In SwiftUI, you can just bring up a Previews window, and with a small amount of code, you’ll have a live simulator of your file! And it updates live right beside your code as you make changes!

On our journey to understanding the SwiftUI framework, we will be solving some problems in the great and splendid Mangoville, a small town that doesn’t have access to Xcode. I already got tons of requests from Mangopolitans!
The town of Mangoville is in desperate need of help. Luckily SwiftUI can be used to create some really cool stuff. (Drawing credit: my sister.)

On our journey to understanding the SwiftUI framework, we will be solving some problems in the great and splendid Mangoville, a small town that doesn’t have access to Xcode. I already got tons of requests from Mangopolitans!

Here’s a list (which will be updated as I post new ones) so that you can get a bit familiar with the problems we will be solving:

  • Intro to Buttons: Captain Shilly Shally needs help choosing a good gift for his wife (it’s their 21st anniversary).
  • Intro to Toggles: Zookeeper Furry Wool absolutely needs a Toggle Switch that will allow him to speak to his animals again.
  • Intro to Pickers: Miss Cookie Doe needs an app that will allow her customers to order from home.
  • Intro to Timers: Stiff Torpid, the slowest man alive, needs a timer to get faster.

That’s all! I hope you like my SwiftUI blog entries.

You Might Also Like

No Comments

Leave a Reply