Learn the basics of SwiftUI
Grey Esteban
yhancogrey@gmail.com
Step 1
Create a new iOS App project in Xcode
Step 2
Replace the contents of ContentView.swift except the import with this one.
From here we could already learn a lot of things:
A. You can stack elements horizontally by just placing them inside an HStack
B. The Rectangle and Text colors automatically adapt to Light Mode and Dark Mode
C. Rectangle by default occupies all the available space
D. They don't occupy the notch and the bottom chin. These are regions where they might be obscured.
Step 3
Replace HStack with VStack. Now, the elements align vertically.
Step 4
Add a frame modifier to Rectangle to set its size.
Step 5
Add a foregroundColor modifier to Rectangle to set its color
Join waitlist and get a free guide.
A community of developers showcasing their work, publishing tutorials and putting their name on the map.