Day143 — path to iOS developer

Section 17

SwiftUI

  • VHZ Stack layout
  • Highly reusable UI component
  • Cross Platform (iPhone, iPad, Watch)

command + click

  • Embed in HStack/VStack/List
  • Extract SubView

preview custom layout NOT inside a phone bezel

Managing State

SwiftUI uses the @State property wrapper to allow us to modify values inside a struct, which would normally not be allowed because structs are value types.

Mutating Struct

Identifiable

computed properties

return objectID for id to mark it Identifiable

Create array instance

ObservableObject

NavigationLink

Construct a SwiftUI version of UIKit component

Summary

SwiftUI is at its early stage. It depends on apple to provide more features. UIKit has way more layout properties, but I can’t resist declarative ui.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store