А
Size: a a a
А
LB
РС
НГ
РС
РС
var pointOfStackView: CGPoint?
var stackView: UIStackView!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillAppear), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)
}
@objc private func keyboardWillHide(notification: NSNotification) {
guard let pointOfStackView = pointOfStackView else { return }
stackView.center = pointOfStackView
}
@objc private func keyboardWillAppear(notification: NSNotification) {
pointOfStackView = stackView?.center
let userInfo = notification.userInfo!
let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
stackView.center = CGPoint(x: view.center.x, y: view.frame.height - keyboardFrame.height - 16.0 - stackView.frame.height / 2)
}
AA
var pointOfStackView: CGPoint?
var stackView: UIStackView!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillAppear), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)
}
@objc private func keyboardWillHide(notification: NSNotification) {
guard let pointOfStackView = pointOfStackView else { return }
stackView.center = pointOfStackView
}
@objc private func keyboardWillAppear(notification: NSNotification) {
pointOfStackView = stackView?.center
let userInfo = notification.userInfo!
let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
stackView.center = CGPoint(x: view.center.x, y: view.frame.height - keyboardFrame.height - 16.0 - stackView.frame.height / 2)
}
РС
AA
АК
AA
АК
AA
АК
AA
AT
Д