custom-keyboard

How to make custom keyboard only for my app in Swift?

两盒软妹~` 提交于 2019-11-29 07:49:36
How to make custom keyboard only for my app in Swift? I do not want people to go to setting and then add keyboard. I want them to be able to use it immediately when they want it on my app. No extra work needed. How to implement this in Swift? Many links only talks about add new keyboard in setting. I don't want that. I'm quite new to UI please give me detail explanation. The UITextField and UITextView classes that you use for text input both have an inputView property. This property is nil by default, but if you provide it with a view, that view will pop up instead of the normal keyboard when

How to play keyboard click sound in custom keyboard?

╄→гoц情女王★ 提交于 2019-11-29 05:42:00
I had created custom keyboard with UIView . However I didn't hear click sound of keyboard. So I tried following codes.But I can't hear anythings. How can I play that keyboard click sound? NSURL* musicFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Tock" ofType:@"aiff"]]; AVAudioPlayer *click = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil]; [click setVolume:0.15f]; [click play]; And also I tried next one. AudioServicesPlaySystemSound(0x450); How can I? Try this: [[UIDevice currentDevice] playInputClick]; Note that Use this method to play the standard

UILexicon in Objective-C

前提是你 提交于 2019-11-29 05:05:34
How do you use UILexicon in Objective-C? I find the documentation Apple provides is extremely unhelpful. What does it do? Does it return a dictionary or proper spellings of words? Or do I provide a word like "hellllo" and it matches it with the proper spelling "Hello" and returns that as a string? Any help would be appreciated. requestSupplementaryLexiconWithCompletion: Here's my error report, but obviously I'll have errors because I'm completely guessing how to use the function, no clue what goes inside the block statement (because the docs (at the time) don't say! (Beta 4 docs)) Hahahah! I

Custom Keyboard extension with UITextField

老子叫甜甜 提交于 2019-11-29 02:37:44
I have custom keyboard extension with UITextField in it. I am able switch to UITextField 's text input, but cannot switch back to self.textDocumentProxy . Does anybody know, how to do something like [self.textDocumentProxy becomeFirstResponder] ? (By the way, it looks like "GIF Keyboard" app provides such possibility) landonandrey I've implemented next workaround for this: My textFied inherits from UITextField . UserInteraction disabled to prevent it from becomeFirstResponder (because you are not able switch back to system input). I've added blinking UIView as cursor imitation ( blinking

Allow Full Access check in keyboards iOS10

你。 提交于 2019-11-28 09:28:20
Recently iOS has an update of iOS 10 & there are certain changes for developers one of the change is now we can't check allow full access the way we did previously is given below -(BOOL)isOpenAccessGranted{ return [UIPasteboard generalPasteboard]; } I searched the latest Developer Guide for UIPasteboard , but was unable to solve it. Did any one has a proper solution for this. iOS11 and above is easy. iOS10 Solution: Check all the copy-able types, if one of them is available, you have full access otherwise not. -- Swift 4.2-- override var hasFullAccess: Bool { if #available(iOS 11.0, *){ return

Add Stickers in Custom KeyBoard Extension

吃可爱长大的小学妹 提交于 2019-11-28 02:14:59
问题 I am looking to create a Custom Keyboard for iPhone,iPad. I have successfully integrated Phrases and Emoticons into the Keyboard, But couldn't get any idea how to add stickers in the keyboard. Anyone knows how to add ? Thanks. 回答1: I recently created a custom keyboard for sending stickers on iPhone. I noticed this question is tagged as Objective-C but I will be responding in Swift since that’s how I did it. If I am understanding your question correctly, “add stickers in the keyboard” may

How to make custom keyboard only for my app in Swift?

不羁岁月 提交于 2019-11-28 01:22:08
问题 How to make custom keyboard only for my app in Swift? I do not want people to go to setting and then add keyboard. I want them to be able to use it immediately when they want it on my app. No extra work needed. How to implement this in Swift? Many links only talks about add new keyboard in setting. I don't want that. I'm quite new to UI please give me detail explanation. 回答1: The UITextField and UITextView classes that you use for text input both have an inputView property. This property is

UILexicon in Objective-C

≡放荡痞女 提交于 2019-11-27 22:36:55
问题 How do you use UILexicon in Objective-C? I find the documentation Apple provides is extremely unhelpful. What does it do? Does it return a dictionary or proper spellings of words? Or do I provide a word like "hellllo" and it matches it with the proper spelling "Hello" and returns that as a string? Any help would be appreciated. requestSupplementaryLexiconWithCompletion: Here's my error report, but obviously I'll have errors because I'm completely guessing how to use the function, no clue what

Open My application from my keyboard extension in swift 3.0

你。 提交于 2019-11-27 18:55:09
问题 I am trying to open from my keyboard extension. I am having custom keyboard and I have add that keyboard from setting. On my custom keyboard there is one button “Show More”, and I want to open my app on this button click. So I have tried following code : let context = NSExtensionContext() context.open(url! as URL, completionHandler: nil) var responder = self as UIResponder? while (responder != nil) { if responder?.responds(to: Selector("openURL:")) == true { responder?.perform(Selector(

How to detect Orientation Change in Custom Keyboard Extension in iOS 8?

拟墨画扇 提交于 2019-11-27 18:07:57
In Custom Keyboard Extension , we can't use `didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation` and sharedApplication . I need to detect portrait or landscape in keyboard when rotate. How can i detect when orientation change in Custom Keyboard extension? Matt In order to update your custom keyboard when the orientation changes, override viewDidLayoutSubviews in the UIInputViewController . As far as I can tell, when a rotation occurs this method is always called. Additionally, as the traditional [UIApplication sharedApplication] statusBarOrientation] doesn't