Force UIKeyboardAppearance Reload - ios

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.

Related

Strange Transparent View Appears Beneath Textfield in Mac Catalyst App

I'm in the process of creating a Mac Catalyst app from my existing iOS app. My problem is this strange transparent view that appears beneath my secure textfields. It appears when the textfield gets the focus by clicking into it, entering one or more characters and deleting every character in the textfield. This does not happen on iOS. The app is all UIKit and Swift no SwiftUI involved.
In the first image you can see there's a character in the textfield.
The second I delete it, this strange view appears. I can not remove this view by clicking somewhere else within the app's window. I can remove it, however, by switching to another app or by hitting the escape key.
In the third image you can see another instance of this transparent view/panel/window on a white background where it can be seen more clearly.
Unfortunately, it's not possible to capture it in Xcode's "Dubug View Hierarchy" since the view is gone the second the app goes to the background.
User rene seems to have the exact same problem but he's using SwiftUI which I don't.
I read through posts regarding similar issues and they seem to be solved by telling the secure UITextField that its "textContentType" is ".oneTimeCode" or anything else except ".password" but that idea didn't help me with my problem. I tried setting the "textContentType" and I tried setting the "keyboardType" as well. Both approaches failed solving my problem.
I have the impression that the OS is trying to present me the "passwords" feature so that I don't have to type in a password but this is only a theory since I don't see the grayish view saying "Passwords".
User Eddie Ed mentions a similar problem but hasn't gotten any answers yet.
Maybe it's simply a bug with Catalyst, I don't know. I haven't filed a radar yet. Hopefully, you helpful people have an idea or encountered and solved this problem one way or another. Any help is appreciated. Thank you.

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.

iOS 8 Interactive notifications not showing buttons by default

I'm working with the new interactive notifications in iOS 8; it fails to get the action buttons (in "banner mode") to show up by default. As it is now I have to slide down on top of the notification to see them.
Is this the default behavior, or is my code rotten?
For the images below I am using XCode 6.1.1 + iOS 8.1 (Simulator)
What I get:
What I want:
This is the default behaviour and no problem with your code.
For more details refer to the below tutorial, result is same as yours.
http://www.thinkandbuild.it/interactive-notifications-with-notification-actions/
Its a default behaviour. Don't worry about this. Apple says:
When a notification is delivered, the system displays a button for each custom action associated with the notification. Tapping a button launches your app (either in the foreground or background) and gives you a chance to perform the indicated action. You use this class to specify the text that is displayed in the button and the information your app needs to perform the corresponding action.
The options are not default behaviour. That can be done via - UIUserNotificationCategory
Refer this WWDC video - https://developer.apple.com/videos/wwdc/2014/?include=713
It's pretty straight forward and easy to implement. Let me know if you face any issues.
Everything is behaving normally. All that needs to be done is to drag down the bottom horizontal bar in the banner and the action buttons would be visible in the banner.
PS - As of iOS8. Once iOS9 comes in in a few more days, no guarantees if this is how it will still be.

App breaks after sliding in the Control Center, leaving and coming back fixes it

Has anyone ever had this issue:
When you slide your finger from the bottom of your iOS screen to the top, it shows the control center - and then you swipe your finger down to get rid of it, but now when you try to use your app - a lot of the dynamic content is completely broken.
After pressing the home button and coming back to the app, everything is back to normal.
It appears the Control Center breaks my dynamic code - which is basically just a UIWebView that I'm assuming is not refreshing properly.
Does this have something to do with the "app entering the background" and "coming back to foreground"... or is there some sort of event where I can track what's going on?
This is a very strange issue.
It seems I was improperly using "applicationWillResignActive" when I really wanted to use "applicationDidEnterBackground".
By making sure to use "applicationDidEnterBackground" instead of the "applicationWillResignActive", my app appears to function perfectly fine again. Viewing the Control Center or Notification Center no longer breaks my app.
Hope this helps someone else who makes a silly mistake.

Copy selection is more trigger happy in UIWebView for iOS6 compared to iOS5

I'm using a UIWebView and have noticed the copy feature is much much more trigger happy in iOS 6 than in iOS 5.
If I display a web page with a small button then on iOS 5 I had no problems clicking the button, however on iOS 6 its very very easy for the OS to interpret the clicking of the button as a desire to copy the button or the whole screen and either the button, or the while UIWebView screen, or first the button then the screen gets highlighted for copying.
How can I disable this from happening?
This question is very similar to this question.
The top answer given is very thorough and should be of use to you.

Resources