Como escrever notificações de teclado no Swift 3

Estou tentando atualizar esse código para o swift 3:

NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("keyboardWillShow:"), name: UIKeyboardWillShowNotification, object: nil)

NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("keyboardWillHide:"), name: UIKeyboardWillHideNotification, object: nil)`

Até agora, eu apenas tentei as correções automáticas fornecidas pelo compilador. Isso resulta em código como este:

let notificationCenter = NotificationCenter.default()
notificationCenter.addObserver(self, selector: Selector(("keyboardWillShow:")), name: NSNotification.Name.UIKeyboardWillShow, object: nil)

notificationCenter.addObserver(self, selector: Selector(("keyboardWillHide:")), name: NSNotification.Name.UIKeyboardWillHide, object: nil)`

Infelizmente, isso não me leva longe, resultando em erros adicionais.

Alguém resolveu isso, por favor?

Observe que estou apenas tentando escrever as notificações. Ainda não estou tentando corrigir as funções de notificação .. Obrigado

questionAnswers(7)

yourAnswerToTheQuestion