Home > database >  Value of type 'some View' has no member 'badge'
Value of type 'some View' has no member 'badge'

Time:10-26

I'm unable to use a property badge in a tabview as xCode complains:

Value of type 'some View' has no member 'badge'

.

var body: some View {
      TabView {
          Text("Your home screen here")
             .tabItem {
                 Label("Home", systemImage: "house")
              }
              .badge(5)
      }
 }

CodePudding user response:

It is available only starting with iOS 15, and can be built starting with Xcode 13

See availability in SwiftUI declaration:

demo

  • Related