I have added textfield (keyboardTextField) and UISwitch on top of my custom keyboard. I can set focus ON or OFF for (keyboardTextField) on the base of Switch value my code.
- (void)switchToggled:(id)sender
{
UISwitch *mySwitch = (UISwitch *)sender;
if ([mySwitch isOn])
{
[keyboardTextField becomeFirstResponder];
}
else
{
[keyboardTextField resignFirstResponder];
}
}
So whats happening right now at first time when my custom keyboard launch its working in each app of my device,But it's impossible for me to select the input view of the main app back after changing Switch value to On and then OFF and now my custom keyboard can't write any thing in any app of my device.
This type of questions already has been asked here and here but no one answered yet. If someone have any workaround or any ideas, Please share.
I'm making an extension keyboard for IOS and have same problem like you. My purpose is to add an UISearchBar to keyboard like this app but I could not find an answer in any forum where I posted this question.
I even asked Apple Technical support but they answered that this is a bug of iOS keyboard extension.
Last day I found an app is Kanvas keyboard and I think a have my solution, and that's use an UILabel instead UITextField or UISearch in the extension.
That will keep my app work fine. Hope this can help you.
Related
I have 2 ViewControllers in an OSX swift project using storyboards. My aim is, when I click the button, the IBAction is called and the view also switches. However, despite my IBAction seeming to be good (I dragged it on and did println("hi")) "hi" is not printed, but the viewcontroller is changed. I would think it were an XCode glitch if I didn't know better, but for the life of me I can't think of what I'm doing wrong. Is anyone able to replicate this?
Can you paste the ViewController code? Is this the first time you hooked up an IBAction to that button? There might be an existing connection in the connections inspector which you haven't closed out yet?
I am having a very strange problem.
I have a tableView, which when the cell is clicked it segues to the next VC, sending the data from that cell with it via prepareForSegue function. From the next VC I then segue from there to another VC (again passing the data needed via prepareForSegue). The final VC is a chat style VC, so it contains a scrollView and a textView, the three VCs look like so:
In the chatViewController I have set up a Parse backend so it queries the data and then places inside the scrollView like so:
The problem I am having is that the keyboard does not pop open. I know the code is CORRECT! As it pops open when I make the chatViewController the initial VC. it just doesn't work when it is segued to from multiple VC.
Does anybody have any ideas on this or ever had any problems with segueing into a scrollViewController. I've tried everything I can think off.
Thanks in advance.
If you're on ios simulator, the software keyboard may be turned off. For actual emulation you may try a ios phone instead of simulator.
If you wanna appear the soft-keypad in simulator try following
solution
iOS Simulator -> Hardware -> Keyboard
Uncheck "Connect Hardware Keyboard"
Mine was checked because I was using my mac keyboard, but if you make sure it is unchecked the iPhone keyboard will always come up.
solution is actually copied from here
Hi all for some reason in my iOS project on the latest Xcode6 the keyboard is refusing to appear anymore when I click inside a input textfield or textview.
I did have one of my fields dismissing the keyboard via
.h
IBOutlet UITextField *textField; {
}
- (IBAction)dismissKeyboard:(id)sender;
.m
- (IBAction)dismissKeyboard:(id)sender {
[textField resignFirstResponder];
}
but even when I delete this code, even tried deleting the view controller files & storyboard and have tried dragging the input textfield/view onto my other view controllers/views and still it refuses to appear no matter where I put it!
Also tried doing a clean, restarting Xcode and the Mac itself.
At the moment I don't even have any custom code in my controller file .m or h.
Apart from restarting the project I'm not sure how I get this default behaviour of the keyboard appearing when clicking inside an input back!
The only thing I have been doing in my other storyboard view controllers is experimenting with constraints/autolayout.
Scratching my head, apart from starting a new project file I'm not sure what to do, any help would be great
Boss, Go to Simulator-> select Hardware -> go to keyboard -> and then do toggle keyboard.It works.Cheers
I'm quite new to iOS Programming. I've done Objective-C for about a year, and now I want to start making apps for the iPhone. I think I'm missing out on something really simple, though. What I've done is this:
First I created a new Single View Application with TestApp as a product name. I enabled Use Storyboards, Use Automatic Reference Counting and Include Unit Tests. After creating the project, I dragged a UIButton onto the View in the storyboard file.
Note that I didn't write a single line of code. I launched my app in the iPhone Simulator and pressed the button, but it's not responding. I know I didn't assign an action to the press of the button, but the gradient of the button isn't changing, as I know it should. The User Interaction Enabled properties of both my view and my button were enabled.
Recently, I've created a few apps in Xcode that worked just fine, but I didn't use storyboards in those projects. Thus, I'm guessing there's something extra to do when using storyboards of which I'm just unaware. I'm using Xcode 4.5 and the iPhone 6.0 Simulator.
I wrote NSLog(#"View was loaded."); statement in the viewDidLoad method of my ViewController to make sure this view controller was actually loaded. (I know my button wouldn't show up if it was the wrong view controller, but I did this just to make sure.)
I also wrote a changeTitle: method in my ViewController to change the title of my button to New Title after it was pressed, just in case the button worked but its gradient just wouldn't respond to a tap. I linked this IBAction to my button, but it wasn't called.
In my ViewController, I created an IBOutlet of a UIButton which I connected to my button. In the viewDidLoad method of my ViewController, I changed the title of my button to New Title, this actually worked. The title of my button changed to this new title when launching my app in the iOS Simulator. The button itself still wasn't responding, though.
As a last try, I also wrote [button setEnabled:YES]; in my ViewController's viewDidLoad method, but this didn't help. My button still doesn't respond to any tap. What am I missing out on?
This is weird. I had an issue with my printer, so I restarted my computer. After this, this issue was suddenly solved as well (just like my printer issue). I'm not sure how this could have affected anything, but I'm glad it works again!
Ran into the same issue.
Apparently Content Reseting the Simulator worked for me
Very strange this..
I'm working on embedding a WebView in Cocoa. I have the basic view up and running, but the problem I'm facing is when I type using either the keyboard or the on-screen keyboard, I get a beep from my Mac and none of the characters are actually shown in the Web view's text field.
I've been going through the web view's reference guide from Apple, but couldn't find anything related to this.
Any help is much appreciated!
Thanks,
Teja.
Omz's comment solved the issue for me. I changed my NSWindow styleMask to a style that can become a key window:
window.styleMask = NSTitledWindowMask