Skip to content

Instantly share code, notes, and snippets.

@takoikatakotako
Created March 11, 2024 23:06
Show Gist options
  • Select an option

  • Save takoikatakotako/55cac64100c1c2bb05970ac144e7ab28 to your computer and use it in GitHub Desktop.

Select an option

Save takoikatakotako/55cac64100c1c2bb05970ac144e7ab28 to your computer and use it in GitHub Desktop.
SwiftUIでTabViewを使って画面を切り替える
import SwiftUI
struct ContentView: View {
var body: some View {
TabView {
Text("First Tab")
.tabItem {
Image(systemName: "1.square.fill")
Text("First")
}
Text("Second Tab")
.tabItem {
Image(systemName: "2.square.fill")
Text("Second")
}
Text("Third Tab")
.tabItem {
Image(systemName: "3.square.fill")
Text("Third")
}
}
.font(.headline)
}
}
#Preview {
ContentView()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment