티스토리 뷰

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
override func viewDidLoad() {
        super.viewDidLoad()
 
         NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil)
    }
 
func keyboardWillShow(notification:NSNotification) {
        let userInfo:NSDictionary = notification.userInfo!
        let keyboardFrame:NSValue = userInfo.valueForKey(UIKeyboardFrameEndUserInfoKey) as! NSValue
        let keyboardRectangle = keyboardFrame.CGRectValue()
        let keyboardHeight = keyboardRectangle.height
        
        print("키보드 : \(keyboardHeight)")
        
    }
cs


댓글
댓글쓰기 폼