isak.me - a blog by isak solheim

Bi-weekly updates about things that interest me, things I have built and things I have learned.

Cannot find 'MenuBarExtra' in scope Fix

MenuBarExtra is only available for macOS 13+. If you encounter the error above, make sure that your Xcode version is at least 14.1.

import SwiftUI

@main
struct ScrollApp: App {
  var body: some Scene {
    MenuBarExtra("Menu Bar", systemImage: "circle") {
      Text("Hello, Menu Bar!")
      Image(systemName: "globe")
      Rectangle()
    }.menuBarExtraStyle(.menu)
  }
}