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

175
Views
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 answers
Answer question

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 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!