Created
September 16, 2021 06:50
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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