Post

Replies

Boosts

Views

Activity

Button Labels in MenuBarExtra not showing images/icons
As the title suggests, the icons/images in labels are not appearing in the MenuBarExtra Here is the code I'm running: import Combine import SwiftUI class TimerViewModel: ObservableObject { private var assignCancellable: AnyCancellable? = nil @Published var somelist: Array<String> = ["default"] init() { assignCancellable = Timer.publish(every: 5.0, on: .main, in: .default) .autoconnect() .map { String(describing: $0) } .assign(to: \TimerViewModel.somelist[0], on: self) } } @main struct mbe_testingApp: App { @State var clickCount = 0 @ObservedObject var timerOutput = TimerViewModel() var body: some Scene { MenuBarExtra("mbe test", systemImage: "\(clickCount).circle") { Button() { clickCount += 1 print("incremented") } label: { Label("Increment", systemImage: "plus.square.fill") } Button() { if clickCount > 0 { clickCount -= 1 } print("decremented") } label: { Label("Decrement", systemImage: "minus.square.fill") } Button() { print("clicked") } label: { Label(timerOutput.somelist[0], systemImage: "clock") } } } } which results in a menu that looks like: What am I missing to make the label images appear alongside the text on the menu buttons?
1
0
735
Mar ’23