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

266
Views
¿Cómo escribir notificaciones de teclado en Swift 4.2?

Estoy tratando de actualizar este código de Swift 3 a Swift 4.2

 NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidShow), name: .UIKeyboardDidShow, object: nil);

Hasta ahora, solo probé las correcciones automáticas proporcionadas por el compilador. Esto da como resultado un código como este:

 NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidShow), name: .UIResponder.keyboardDidShowNotification, object: nil);

Desafortunadamente, eso no me lleva muy lejos, lo que genera un error adicional: "El tipo de expresión es ambiguo sin más contexto"
¿Alguien ha solucionado esto por favor? ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Simplemente reemplace .UIResponder.keyboardDidShowNotification con UIResponder.keyboardDidShowNotification y resolverá su problema.

Y el código final será:

 NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidShow), name: UIResponder.keyboardDidShowNotification, object: nil)
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!