keyboardGuide.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
keyboardGuide.topAnchor.constraint(equalTo: textView.bottomAnchor).isActive = true
keyboardHeight = keyboardGuide.heightAnchor.constraint(equalToConstant: view.safeAreaInsets.bottom)

NotificationCenter.default.addObserver(self, selector: #selector(respondToKeyboard),
																							name: UIResponder.keyboardWillShowNotification,
																							object: nil)
@objc func respondToKeyboard(notification: Notification) {
	let info = notification.userInfo
	if let endRect = info?[UIResponder.keyboardFrameEndUserInfoKey) as? CGRect {
		var offset = view.bounds.size.height - endRect.origin.y
		if offset == 0.0 {
			offset = view.safeAreaInsets.bottom
		}

		let duration = info?[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval ?? 2.0
		
		UIView.animate(withDuration: duration, animations: {
			self.keyboardHeight.constant = offset
			self.view.layoutIfNeeded()
		})
	}
}