custom-keyboard

swift ios keyboard extension - long press / press and hold

*爱你&永不变心* 提交于 2019-12-04 18:23:37
I need to know how to add long press (press and hold) function to ios custom keyboard extension so that i con show multiple keys to chose one from. expected design my project structure current code for keypress action - code can add the title of the button pressed as a new text into any proxy text field. @IBAction func keypress(sender: UIButton!){ let typedCharacter = sender.titleLabel?.text let proxy = textDocumentProxy as UITextDocumentProxy proxy.insertText(typedCharacter!) } func loadKeyboard(){ let keyboardNib = UINib(nibName: "View", bundle: nil) keyboardView = keyboardNib

Communicate with Custom Keyboard extension with Host App not working in device but works in simulator

混江龙づ霸主 提交于 2019-12-04 17:52:27
I am working with custom keyboard extension. that almost done but i just facing issue with device when i communicate data with extension and my host app that not woking in device but same thing this working in simulator. My code is following: HostApp View controller: - (void)viewDidLoad { _defaultvalue = [[NSUserDefaults alloc] initWithSuiteName:@"group.myapp.myappname.targetKeyboard"]; [_defaultvalue setBool:YES forKey:@"Layout"]; [_defaultvalue synchronize]; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (IBAction)RightAction:(id)sender {

How to add images as text attachment in Swift using nsattributedstring

五迷三道 提交于 2019-12-04 02:45:47
I'm trying to build a custom keyboard for iOS using images which I've put in as buttons. When I press a button, the image linked to the button is put into an attributed string which is loaded into an UiTextView inside the custom keyboard view. That is working. The problem is that when I append a new image to the attributed string both the old and new images in the string are changing to the image I currently pressed on. I can't understand why the old images in the string are changing. Any suggestions? I've tried using replaceCharactersInRange and insertAttributedString but can't get it to work

When making a custom iOS keyboard extension, how can I create a button that has the same functionality as Apple's original backspace key?

两盒软妹~` 提交于 2019-12-03 20:11:25
I am making a customKeyboard which have delete button for delete a text and code for that is: func addDelete() { deleteButton = UIButton.buttonWithType(.System) as UIButton deleteButton.setTitle(" Delete ", forState: .Normal) deleteButton.sizeToFit() deleteButton.setTranslatesAutoresizingMaskIntoConstraints(false) deleteButton.addTarget(self, action: "didTapDelete", forControlEvents: .TouchUpInside) deleteButton.layer.cornerRadius = 5 view.addSubview(deleteButton) var rightSideConstraint = NSLayoutConstraint(item: deleteButton, attribute: .Right, relatedBy: .Equal, toItem: view, attribute:

How can I add button icons to custom keyboard iOS 8?

霸气de小男生 提交于 2019-12-03 16:15:30
I am creating custom keyboard for ios 8. Creating keyboard buttons like this UIButton *aBtn = [ UIButton buttonWithType:UIButtonTypeCustom ]; [aBtn setFrame:CGRectMake(x, 30, btnWidth, btnHeight)]; [aBtn setImage:[UIImage imageNamed:@"A"] forState:UIControlStateNormal]; [aBtn setTitle:@"A" forState:UIControlStateNormal]; [aBtn setTitleColor:[ UIColor blackColor] forState:UIControlStateNormal]; [aBtn setTitleColor:[ UIColor whiteColor] forState:UIControlStateHighlighted]; [aBtn addTarget:self action:@selector(btnClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:aBtn

ERROR ITMS-9000: \"Invalid architecture: Apps that include an app extension and a framework must support arm64

谁说胖子不能爱 提交于 2019-12-03 11:42:00
I want to upload build with Custom keyboard extension on Itunes Connect But when I am going to upload it on Itunes Connect through Application loader its show me following error ERROR ITMS-9000: "Invalid architecture: Apps that include an app extension and a framework must support arm64 I have added valid architecture to "Armv7",armv7s,arm64 in keyboard extension target and app target as well.but I am still facing same problem Please check your embedded frameworks, if any. I've faced the same issue and the reason was: While debugging app on device, Xcode builds frameworks for "current arch

How to make custom keyboard extension become first responder again

这一生的挚爱 提交于 2019-12-03 11:32:49
I am making a custom keyboard extension, and in this keyboard, i have another uitextfield as a search field, so when I type on the custom keyboard, I am not sending the text to the safari's textfield or some chat app's textfield, I am sending the text to the uitextfield search field in the custom keyboard, so I can do some search and then when the search results come back, i am sending the search result to the safari's textfield or some chat app's textfield. So there is a first responder issue here. When I set the search text field as first responder, and trying to set the first responder back

how can I create and access share app group document directory?

Deadly 提交于 2019-12-02 14:12:45
i am using custom keyboard extension then download keyboard theme from server and save in to app document directory but app document directory can not access in custom keyboard extension so, required to share app group directory. how can i do please help me. Now i am trying this but its not working. let fileManager = FileManager.default if let directory = fileManager.containerURL(forSecurityApplicationGroupIdentifier: "group.companyname.appname") { //let newDirectory = directory.appendingPathComponent(dataPath) newDirectory = directory.appendingPathComponent("MyDirectory") try? fileManager

iOS CoreBluetooth state unsupported when using in iOS custom keyboard

自古美人都是妖i 提交于 2019-12-02 12:10:51
问题 I want to use CoreBluetooth API within iOS keyboard extension (custom keyboard). However, the state for the CBCentralManager is unsupported. The device I use is iPhone 6. It works fine inside the container app. Does this mean that the CoreBluetooth API cannot be used inside the keyboard extension? 回答1: You will need to set RequestOpenAccess to YES in your extension's plist under NSExtension > NSExtensionAttributes. Setting this to YES allows the extension to access network resources.

Adding a minus sign to the UITextField's .NumberPad keyboard

霸气de小男生 提交于 2019-12-02 11:45:38
问题 Fairly new to iOS development so forgive me for asking something that might be quite obvious. As you all know the UITextField's keyboard with keyboardType set to .NumberPad looks like the following... .NumberPad keyboard What I would like to do is replace the empty space in the lower left corner with a minus sign. Is this possible or does one need to write an entire custom keyboard to achieve this? Would really appreciate the help. 回答1: Add a toolbar to your textfield inputAccessoryView and