この記事がいい
宣言的UIフレームワーク 「SwiftUI」と「Flutter」を比較してみた - dely engineering blog
https://dev.classmethod.jp/smartphone/iphone/lean-swiftui/
VS Codeで編集してもホットリロード出来ない
あとフォーマットがないので入れる。
Xcodeで使えるSwiftコードフォーマッター「Swimat」をつかってみた - Qiita
この公式で
Apple Developer Documentation
+マークどこ?
最初のところは
struct ContentView: View {
var body: some View {
VStack(alignment: .leading) {
Text("Turtle Rock")
.font(.title)
HStack {
Text("Joshua Tree National Park")
.font(.subheadline)
Spacer()
Text("California")
.font(.subheadline)
}
}
.padding()
}
}
ってなったのに、
Text("Turtle Rock")
がなぜかさらにVStack
の配下に変わってる・・。
struct ContentView: View {
var body: some View {
VStack {
MapView()
.frame(height: 300)
VStack(alignment: .leading) {
Text("Turtle Rock")
.font(.title)
HStack(alignment: .top) {
Text("Joshua Tree National Park")
.font(.subheadline)
Spacer()
Text("California")
.font(.subheadline)
}
}
.padding()
}
}
}
・フェイバリット機能
Apple Developer Documentation
スイッチがないときは全部出す、そうじゃないときはisFavoriteのみ。
if !self.showFavoritesOnly || landmark.isFavorite {
・Drawing Paths and Shapes
https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes
Badge.swift
はSupporting Views
の中にいる。
2つ作るとエラーになる。
邪魔なイメージはこれで消せる