키보드 상태값에 다른 함수 호출

override func viewWillAppear(_ animated: Bool) {
        //화면이 표시될때, Keyboard표시에 대한 이벤트가 발생하면 호출되는 함수를 등록한다.
        NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillShow(_:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardDidShow(_:)), name: NSNotification.Name.UIKeyboardDidShow, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillHide(_:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardDidHide(_:)), name: NSNotification.Name.UIKeyboardDidHide, object: nil)
    }

    //키보드가 표시되기 직전
    func keyboardWillShow(_ notification:NSNotification) {

    }
    //키보드가 표시되고 난 다음
    func keyboardDidShow(_ notification:NSNotification) {

    }

    //키보드가 사라지기 직전
    func keyboardWillHide(_ notification:NSNotification) {

    }
    //키보드가 사라진 후
    func keyboardDidHide(_ notification:NSNotification) {

    }

results matching ""

    No results matching ""