Sometimes we need to show our custom accessory view when UITextField/UITextView is in editing mode or being edited. We can use inputAccessoryView property to assign a view just above the system keyboard.
Input accessory view is very helpful when you are dealing with UITextView. Because when you press return key it actually starts a new line and user can’t end editing from the UITextView. But with the help of inputAccessory view you can overcome such problems with ease.
Here I’m going to tell you how you can add a toolbar as custom accessory view for UITextField or UITextView in swift.
1- Create an instance of toolbar with with it’s frame.