Change uitextfield using the dismiss keyboard icon on the iPad - ipad

On the iPad there is an icon to dismiss the keyboard on the bottom right of the screen. When a user changes their input data, and taps on this icon, the prior results (calculations) are still displayed. I need to change the UITextField results so that they know they must tap on my submit button to update the results. Any thoughts?

If your code is looking for the UIKeyboardWillHideNotification, you'll know when you can update your calculations.
Sample code can be seen here.
p.s. welcome to StackOverflow! For future questions, it might be useful to tag then with the language that you're using (objective-c or swift), as well as ios.

Related

iOS keyboard keys move off top of screen

I've inherited a partially finished app that I need to finish. Unfortunately there seems to be a bug involving the display of the keyboard. The bug does not occur when opening the app on my iPhone, but it does appear in the simulator, and I'm being told it also appears on iPad.
When selecting a text field on the affected , the keyboard background rolls up in the right spot. However, the keyboard buttons appear near the top of the screen, and then rolls up until they can no longer be seen. If another text field is selected, the keyboard buttons appear so that they are visible, but still at the top of the screen, instead of down on the keyboard background. The problem can be seen in this video:
https://vid.me/0bEs
I've searched through the code, and I can't find anything overt that should cause this behaviour. Any ideas would be appreciated.
Have you check in appdelegate or in view controller that is there any observer with selector method. I generally face such issue while working on some other person's code.
Just search in through out project UIKeyboardWillShowNotification, UIKeyboardDidChangeFrameNotification, UIKeyboardDidShowNotification.
Hope you will get something so we can solve this riddle.

Detect Smiley and Globe when selected in iOS 8 keyboard

I need to be able to detect when the user selects the smiley and globe on the iPhone and iPad keyboard so I can resize my view based on if predictive text is supported.
I have tried myUITextView and keyboard delegates but no luck there. Thank you for your help
You want to listen for the UIKeyboardWillChangeFrameNotification notification.
The userInfo dictionary contains information about the keyboards frame, animation duration and curve.
With this info, you can then uplate your UI to move any views out the way if needed etc.
More Info: https://developer.apple.com/library/ios/documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html
If the use selected globe or emoji, your keyboard will be dismissed. Why you need to know?
edit: sorry I though you are building third-party keyboard

How do I support VoiceOver in UIPickerView on an iPad running an iPhone only app (non-universal)?

Generally I look at Apple's UICatalog sample code for basic VoiceOver support however it looks like there is VoiceOver support for UIPickerViews in the sample code. Do I need to provide an accessibilityLabel method somewhere to add VoiceOver support? I tried to implement UIPickerViewAccessibilityDelegate methods but voice over only reads the labels in my picker view and not the hint to swipe up or down to change the values.
Also my picker view is set to the input view of a UITextField. So I'm not sure if that is relevant or not.
Update:
https://github.com/stevemoser/VoiceOverPicker
I created a sample project demonstrating the issue. In the example there is a normal picker view shown and a textfield. There is also a picker that is set to the textfield's input view property. I can't seem to activate the either picker just by tapping on it while using VoiceOver. Though I can activate either one by swiping (left and right) through the views on screen. Any ideas?
Update 2:
Looks like if the app is an iPhone app running on an iPhone or an iPad app running on an iPad it works fine but if it is an iPhone only app running on an iPad, tapping to select a UIPickerView doesn't work.
Are you just doing a vanilla UIPickerView using titles for each row (and not custom views)? If so, there isn't anything that you should have to do.
You mentioned that VoiceOver was correctly reading the label on each row, so we know that the UIPickerView correctly has isAccessibilityElement set to YES. It's also correctly reading the accessibilityLabels.
Is it possible that you're interacting with the picker before it has a chance to read the accessibilityHint? (For the benefit of others, the accessibilityHint is the "swipe or down with one finger to adjust the value" that Steve mentioned in his question.) Or perhaps some notification is changing the VoiceOver focus before the hint has a chance to be read?
By default, if your picker view is accessible, when you focus on it with VoiceOver it will read the something along these lines:
"[ROW LABEL] Adjustable [#number] out of [#total] picker item" a 2 to
3 second pause then "Swipe up or down to select value"
A few of things to note:
There is a 2 to 3 second delay between reading the label and the hint, make sure you wait for it.
If you're providing your own hint, the default one will not get read I believe
Hints are only read when you reach a certain control by either directly pressing it or by swiping right or left to the control. it will not get read if you do a 2 finger swipe down or up.
Make sure you're testing on an actual device and not a simulator as it does not show all of the things VoiceOver announces.

Force UIKeyboardAppearance Reload

I'm working on an iOS app that uses dark keyboards. One such keyboard is affiliated with a UITextView. I create the UITextView and play around with it for a bit and every thing works as it should.
The problem occurs when I dismiss the keyboard and then click the home button and dismiss the app into the background. By reopening my app, I return to the screen on which I just was. When I click on the UITextView, it gives it firstResponder status and the UIKeyboard reappears.
If you check the properties of the UIKeyboard, the appearance is still set to dark but for the first second the keyboard is on the screen it shows as light.
Does anyone know how to force a refresh of the keyboard between the app entering the foreground and the keyboard being displayed?
I do not believe there is anything you can do at this time to fix this. I had a simple project I had just done to send in a bug report to Apple, but it didn't fail in the demo project as it does in my code. I was going to toss that project away when I saw your problem.
So I have verified that even in the very latest unreleased Xcode and iOS beta this still happens. But, since I had the project already, I did enter a bug report on it with the demo project so Apple can see it for themselves.
15586497 "Keyboard flashes from white to dark under one specific test"
If you want to enter your own bug you can say its a dup of the number above, then no need for a demo project.
IMHO, these things do get fixed, but not for a while - maybe iOS 8 if you're lucky, so I think you're just going to have to live with it, or switch to using a white keyboard.

Show iPhone keyboard programmatically

I want show the iphone keyboard. How can I write the code (programmatically) to show the keyboard.
As Jacob said, you'll have to run becomeFirstResponder on a UITextView to make it the first responder, the object the user's currently working with. If you do this, the iPhone OS automatically shows the keyboard, cause that's what's needed for working with a UITextView from a user perspective.
As others have noted, you send the becomeFirstResponder message to the control that you want the keyboard to edit.
One extra thing you should be aware of is that if you plug an external keyboard into an iPad then the keyboard will not appear on screen. You need to design your view so it doesn't look silly without the on-screen keyboard.

Resources