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

211
Views
Deshabilite o elimine el elemento del menú de impresión en una aplicación SwiftUI macOS

¿Cómo puedo deshabilitar o eliminar un elemento de menú en una aplicación SwiftUI para macOS? Por ejemplo, el elemento Print... se muestra en el menú File de forma predeterminada. Pero mi aplicación no utiliza funciones de impresión. ¿Cómo eliminaría el elemento de impresión del menú de archivo en una aplicación SwiftUI para Mac?

elemento de menú de impresión de swiftui

Intenté lo siguiente en AppDelegate.swift pero no funciona:

 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

[por solicitud @Alexander]

Las primeras plantillas de proyectos de SwiftUI tenían recursos explícitos para el menú principal, Main.storyboard (o archivo xib). Si puede encontrar uno en su proyecto, simplemente ubique el menú allí y elimine el elemento del menú Imprimir manualmente.

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!