Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
macOS Quick Look Preview Extension not calling -viewDidDisappear

I'm implementing a Quick Look Preview extension on macOS that will preview some unsupported audio types.

To be able to stop the audio playback when the user stops previewing, I'm pausing my audio engine in -viewDidDisappear.

However, the problem is that -viewDidDisappear is only called when exiting out of Quick Look in Finder altogether, not when I'm navigating to the next/previous file with the arrow keys.

class PreviewViewController: NSViewController, QLPreviewingController {
    func preparePreviewOfFile(at url: URL, completionHandler handler: @escaping (Error?) -> Void) {
        player.load(url)
        player.play()
    }
    
    override func viewDidDisappear() {
        // Not called when switching to the next or previous preview in Finder!
        player.stop()
    }
}

I've tried going through all the usual suspects on both NSViewController (-removeFromParent, -viewWillDisappear, -viewDidDisappear) and it's NSView (-viewDidHide, -viewDidMoveToWindow, -viewDidMoveToSuperview), but without success.

Neither of them are called when I switch to a different file in the Quick Look preview in Finder with the arrow keys (resulting in the audio just continuing to play while I'm Quick Looking some other file).

Anyone knows how to know if my preview view controller has been hidden?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda