SwiftUI_visionOS_Note

.badge

May 8, 2024
0 min read|
struct ContentView: View {
    var body: some View {

        TabView{
            NavigationStack{
                List{
                    Text("Hello, World")
                        .badge("New Items!")
                    Text("Hello, World")
                    Text("Hello, World")
                    Text("Hello, World")

                }.padding()
            }
                .tabItem {
                    Image(systemName: "heart.fill")
                    Text("hello")
                }
                .badge(5)
            
            Color.red.opacity(0.1)
                .tabItem {
                    Image(systemName: "heart.fill")
                    Text("hello")
                }.badge("Press Like")
            
            Color.orange.opacity(0.1)
                .tabItem {
                    Image(systemName: "heart.fill")
                    Text("hello")
                }
        }
    }
}
swift

Subscribe to our newsletter

Get the latest news and updates from our team