Playground에서 App gallery 있는 것들 중 About Me를 해보는 중이다
App /AboutMeApp ... ✅
/ContentView ... ✅
/FavoritesView ... ✅
/FunFactsView ... ✅
/HomeView ... ✅
/StoryView ... ✅
/YourTab ... ✅
ContentView
import SwiftUI
struct ContentView: View {
var body: some View {
/*#-code-walkthrough(ContentView.tabView)*/
TabView {
/*#-code-walkthrough(ContentView.tabView)*/
/*#-code-walkthrough(ContentView.homeTab)*/
HomeView()
/*#-code-walkthrough(ContentView.homeTab)*/
/*#-code-walkthrough(ContentView.tabItem)*/
.tabItem {
Label("Home", systemImage: "person")
}
/*#-code-walkthrough(ContentView.tabItem)*/
StoryView()
.tabItem {
Label("Story", systemImage: "book")
}
FavoritesView()
.tabItem {
Label("Favorites", systemImage: "star")
}
FunFactsView()
.tabItem {
Label("Fun Facts", systemImage: "hand.thumbsup")
}
/*#-code-walkthrough(ContentView.addATab)*/
YourTab()
.tabItem {
Label("Your Tab", systemImage: "heart.fill")
}
/*#-code-walkthrough(ContentView.addATab)*/
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
YourTab
import SwiftUI
struct YourTab: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
struct YourTab_Previews: PreviewProvider {
static var previews: some View {
YourTab()
}
}
👀결과