Hope you had a good winter break! So since we haven’t done much coding last year, we’re going to make up for it this year. For the next couple months, we’ll make iOS apps.
This isn’t App Lab or Scratch or whatever, it’s actual apps that you run on your phone – for example, Weather or Instagram. We’ll be primarily using 3 things:
- Swift Playgrounds
- SwiftUI
- Swift
Swift Playgrounds
This is an IDE, or code editor. It’s super modern and fast, unlike replit or BlueJ. It was just released by Apple in December 2021 and has lots of nice features. It should be pre-installed on the iPad you got.
SwiftUI
If you’ve ever designed or coded a screen or app, you probably know how frustrating it is. SwiftUI simplifies everything and lets you declare interfaces with barely any code. What you see is what you get.
1
2
3
4
5
6
7
8
9
10
11
12
13
struct ContentView: View {
var body: some View {
HStack {
Image(systemName: "hand.wave.fill")
Text("Hello!")
}
.foregroundColor(.white)
.padding()
.background(Color.blue)
.cornerRadius(16)
}
}
Result
Swift
This is the programming language that we’ll be using. It’s faster than python, easier to read than javascript, and simple to pick up.
1
2
let string = "Hello, world!"
print(string)
With that, let’s get started.