プロジェクトを新規作成します。
[File]-[New]-[Project...]

Tabbed Appを選択

ContentView.swift
タブのアイコンと下の文字を変更
selectionとtagを削除
TextとfontをHomeViewとNotificationsViewに変更
struct ContentView: View {
@State private var selection = 0
var body: some View {
TabView(selection: $selection){
Text("First View")
.font(.title)
.tabItem {
VStack {
Image("first")
Text("First")
}
}
.tag(0)
Text("Second View")
.font(.title)
.tabItem {
VStack {
Image("second")
Text("Second")
}
}
.tag(1)
}
}
}
→
struct ContentView: View {
var body: some View {
TabView(){
HomeView()
.tabItem {
VStack {
Image(systemName:"house.fill")
Text("Home")
}
}
NotificationsView()
.tabItem {
VStack {
Image(systemName:"bell.fill")
Text("Notifications")
}
}
}
}
}

[Product]-[Run]実行
