NSNotificationCenter监听TextField文字变化

注册

   1:  NSNotificationCenter.defaultCenter().addObserver(self, selector: "textDidChange", name: UITextFieldTextDidChangeNotification, object: nil)

 

不要忘了移除:

   1:   deinit{
   2:          NSNotificationCenter.defaultCenter().removeObserver(self)
   3:      }
posted @ 2015-05-11 10:13  有奈了  阅读(390)  评论(0编辑  收藏  举报