Khant Thu Linn
Khant Thu Linn

Reputation: 6133

iOS 8 custom keyboard dismiss (from textfield, etc)

In new iOS 8 custom keyboard extension, we can go to next keyboard by this code.

[self advanceToNextInputMode];

How can I dismiss custom keyboard? (not hide, not go to next keyboard). Thanks for your help. :)

Upvotes: 2

Views: 1113

Answers (2)

Mona
Mona

Reputation: 6175

Use the code below,

Objective-C:

[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];

Swift:

UIApplication.sharedApplication().sendAction("resignFirstResponder", to:nil, from:nil, forEvent:nil)

Upvotes: 0

Wessley
Wessley

Reputation: 330

You can use UIInputViewController's dismissKeyboard method.

Upvotes: 4

Related Questions