Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Disable or remove the print menu item in a SwiftUI macOS app

How can I disable or remove a menu item in a SwiftUI macOS app? For example, the Print... item is shown in the File menu by default. But my application does not use printing features. How would I remove the print item from the file menu in a SwiftUI Mac app?

swiftui print menu item

I tried the following in AppDelegate.swift but it doesn't work:

import Cocoa
import SwiftUI

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
    
    func applicationWillFinishLaunching(_ notification: Notification) {
        if let menu = NSApplication.shared.mainMenu {
            menu.item(withTitle: "File")?.submenu?.item(withTitle: "Print...")?.state = NSControl.StateValue.off
        }
    }
    
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

[per-request @Alexander]

Early SwiftUI project templates had explicit resource for main menu, Main.storyboard (or xib file). If you can find one in your project then just locate menu there and remove Print menu item manually.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!