Sep 5, 2024
MemorizeApp
, ContentView
, Assets
, and Project Settings
.ContentView
behaves like a view, not related to superclasses or object-oriented programming.:
indicates behavior, not inheritance.body
to a simple text in ContentView
.Some View
facilitates compiler flexibility in deducing view types.strokeBorder
for outlines.var
vs let
: var
can vary, let
is constant.let
for constants in view builders.onTapGesture
adds interactivity to views.@State
for temporary UI state changes, such as flipping a card.isFaceUp.toggle()
demonstrates Swift's struct capabilities.ForEach
for iterating views over arrays or sequences.LazyVGrid
for grid layouts with columns specified by grid items.Adaptive
grid items allow flexible sizing.ScrollView
.