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

176
Vistas
When can I remove convertToUIApplicationOpenExternalURLOptionsKeyDictionary helper function?

When I migrated to Swift 4.2 last year, Swift 4.2 migrator added a helper function in some of my controllers:

// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertToUIApplicationOpenExternalURLOptionsKeyDictionary(_ input: [String: Any]) -> [UIApplication.OpenExternalURLOptionsKey: Any] {
    return Dictionary(uniqueKeysWithValues: input.map { key, value in (UIApplication.OpenExternalURLOptionsKey(rawValue: key), value)})
}

When is it safe to remove?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Presumably, some function in that file (or in a prior version of the file) calls this UIApplication method:

func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil)

Prior to iOS 12, the method had a different signature:

func open(_ url: URL, options: [String : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil)

When Xcode 10 migrated your project, it added the convertToUIApplicationOpenExternalURLOptionsKeyDictionary function and inserted a call to that function in each call to the open(_:options:completionHandler:) method to translate the options dictionary.

If you update each call to the open(_:options:completionHandler:) method to use the UIApplication.OpenExternalURLOptionsKey constants, you can remove the calls to convertToUIApplicationOpenExternalURLOptionsKeyDictionary and remove the function entirely.

over 4 years ago · Santiago Trujillo Denunciar
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