개발/swift

How to make custom keyboard?

lemonade 2021. 4. 12. 10:00
반응형

How to make custom keyboard?

 

When using textField or textView, you may want to show custom keyboard.

 

For example in facebook messanger, it shows two icons instead of key pad.

 

In that case, you can use textfield inputView.

 

 

 

1. Make your custom view

 

You can use storyboard or programmatically make one.

 

 

2. Add custom view to textField inputView.

 

 

3. Add button click event

 

When button clicked, call becomFirstResponder to show inputView.

 

 

4. That's all!

 

But how to know keyboardFrame?

 

You can get keyboardFrame when keyboard show up.

 

Don't forget to add notification!

 

 

Happy Codding :)

 

반응형
그리드형