Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created September 16, 2021 06:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save amosgyamfi/938283745c618ac27bf3283be25513a4 to your computer and use it in GitHub Desktop.
//
// ContentView.swift
// TwitterChat
//
// Created by Amos Gyamfi on 12.9.2021.
//
import SwiftUI
struct BottomTab: View {
var body: some View {
TabView {
if #available(iOS 15.0, *) {
Text("All mesages") // Show this content when the tab item is tapped
.tabItem { // A tab item consisting of image and text
Image(systemName: "envelope")
Text("Messages")
}
Text("Search for messages")
.tabItem {
Image(systemName: "magnifyingglass")
Text("Search")
}
Text("All notifications")
.badge(10)
.tabItem {
Image(systemName: "bell")
Text("Notifications")
}
} else {
// Fallback on earlier versions
}
}
.font(.headline)
//.padding()
}
}
struct BottomTab_Previews: PreviewProvider {
static var previews: some View {
BottomTab()
.preferredColorScheme(.dark)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment