Code First Girls is a non-profit organisation that provides free tech education to women in England. I recently signed up to one of the MOOC sprints to learn more about iOS development. The programme is for an hour each Wednesday evening for 4 weeks with a quiz and homework. I mainly watched the recordings rather than the live sessions, but here are my notes from the course as I work through it. This is my second MOOC I have done with CFG.
Table to contents here:
Apple has the largest market share for mobile phones (about 33%).
iOS SDK
XCode IDE
Swift = programming language used for iOS apps. Developed by Apple in 2014.
SwiftUI = UI Framework. Developed by Apple in 2019. Declarative program. Structs.
Developer Program = membership program (paid membership but free features)
There are some other ways to create apps with Javascript and ReachJs e.g. Expo, Thunkable, Appy Pie (not covered in this tutorial).
Need to install XCode (can only do this on a Mac)
Create new project
Select iOS App (and then follow instructions)
Pay around with the sample code
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "heart")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("pssst....")
.padding()
}
.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
VStact = view container (vertical) Image() = where to put images (can upload to XCode or use system images) .something = feature of the parent
keywords, operators, data types, identifiers
struct= ContentView; body; ContentView_previews; previews
Protocol = PreviewProvider (allows us to see things in the simulation and is part of SwiftUI)
Draughts. 5 screens.
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Draughts")
.font(.largeTitle)
.padding()
HStack{
Image(systemName: "checkerboard.rectangle")
.imageScale(.large)
.foregroundColor(.pink)
Text("Play")
}
HStack{
Image(systemName: "checkerboard.rectangle")
.imageScale(.large)
.foregroundColor(.pink)
Text("Stats")
}
Text("CFG iOS App Dev MOOC")
.padding()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
I found this really fun. Of course it was very basic because it was the first session. But I already learnt a lot - i had zero experience before doing this MOOC so it was really cool. I got to play around with some of the code to see how it works while also keeping up with the live talk.
SDK = software devlopment kit
Imperative = tell exact steps how the programe needs to be run.
Keywords = reserved words
Protocol = set of rules that a thing (data type etc) must follow; defines methods, properties etc that must exist
Struct = groups related information together; has properties;
View Containers = special type of view; contain views; arrange/group views