swift seloctor 用法

2016-04-13  本文已影响0人  小天9959

private func addNotificationObserver() {

NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(Class.keyboardWillShow(_:)), name:UIKeyboardWillShowNotification, object:nil)

NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(Class.keyboardWillHidden(_:)), name:UIKeyboardWillHideNotification, object:nil)

}

@objc private funckeyboardWillShow(notify:NSNotification) {

print("show+++")

}

@objcprivatefunckeyboardWillHidden(notify:NSNotification) {

print("hidden+++")

}

上一篇下一篇

猜你喜欢

热点阅读