tAvoidingView(self.avoidingView, withTriggerView: iggerView) Use this to set an avoidingView but have a different view that triggers the avoiding. If you need to set the avoidingView, or its properites, dynamically consider putting it in textViewShouldBeginEditing(_ textView: UITextView) If you're unsure put it in viewDidAppear(_ animated: Bool) Put it in viewDidLoad() or viewDidAppear(_ animated: Bool) depending on your usage To set the avoiding view KeyboardAvoiding.avoidingView = self.avoidingView Supported FeaturesĪdd this to your CocoaPods Podfile. ![]() If Autolayout is used then the constraints are animated, otherwise a CGAffine translation is done. And it isn't restricted to keeping UITextFields visible, with IHKeyboardAvoiding any UIView can avoid the keyboard ![]() What sets IHKeyboardAvoiding apart from other keyboard avoiding solutions is that it doesn't require placing your content in a UIScrollView. When the keyboard is dismissed, the avoidingView is returned to its original position. ![]() Register an avoidingView(UIView) with IHKeyboardAvoiding when the keyboard is shown, if the avoidingView's frame will be intersected by the keyboard, then it will move up just above the keyboard. IHKeyboardAvoiding will translate any UIView up when the keyboard is being shown, then return it when the keyboard is hidden. An elegant solution for keeping any UIView visible when the keyboard is being shown
0 Comments
Leave a Reply. |