iOS 8 keyboard layout on iPhone 6/6 Plus - ios

I noticed that on iOS 8, the native keyboard on iPhone 6/6 Plus added some keys in landscape mode.
However when I create an app with UITextView, the keyboard is same as iPhone 5 (without the function keys.) As the screenshot, you can see that the height of keyboards are not same, and the keys are different.
So, how do I change the keyboard appearance as the native one on iPhone 6/6 Plus?

You have to add special launch images for the iPhone 6 and 6 Plus to get the new keyboard layouts.
The reasoning behind this is that the phone runs your app in a special compatibility mode, that emulates a screen resolution of 320 points in width.
You can easily see, if your app runs in such a mode by outputting the screen resolution:
println("bounds = \(UIScreen.mainScreen().bounds)")
println("nativeBounds = \(UIScreen.mainScreen().nativeBounds)")
Without the designated launch images the output of the iPhone 6 Plus Simulator is:
bounds = (0.0,0.0,320.0,480.0)
nativeBounds = (0.0,0.0,960.0,1440.0)
And there will be no special keyboard
To get a comprehensive understanding of the new resolutions see this great blog entry: http://www.paintcodeapp.com/news/iphone-6-screens-demystified

Related

Removing launch screen file from Info.plist scales the views

I noticed something that when you remove the launch screen file entry from the XCode Info.plist file, any view of any view controller becomes scaled according to the screen size, so the views appear zoomed in on large screen sizes such as the iPad Pro (12.9 inches) and appear somehow zoomed out on smaller devices (iPad Pro 9.7 inches).
In that case it seems that the Auto Layout constraints have no effect as the scaling is done automatically.
I really can't understand what does this has to do with the layout constraints, so I appreciate if any one can explain what's the reason for that.
Without being able to provide deep details, iOS uses the launch screen definition (view or static images) to determine which size classes the app should use. If you have not supplied those, it seems you get scaling that you generally do not want.
That doesn't mean auto-layout no longer has any affect... it just means that the auto-layout engine is not using the current screen size for its size/positioning calculations.
You'll see very similar results if you explicitly set your project for iPhone only.
Simple, obvious solution: Don't remove the launch screen.
Yes this is expected behaviour... Same is for iPhone 6 Plus. If you remove the iPhone 6 Plus launch screen, it will display the iPhone 6 scaled version.
This is just for backward compatibility. If your app is not ready for iPad Pro or iPhone 6+, scaled version can be used by removing the respective splashing screens.
All current iPhone apps or iPad apps in AppStore those are not optimised runs as a scaled version.

iOS - New keyboard style on a textview/textfield

I have realised that the keyboard which appears on my application doesn't have the same layout/appearance than others on the same device.
Keyboard that appears on my app:
Keyboard that appears on Safari:
Both screenshots has been taken on the same device with iOS 10.2. The second keyboard has like a modern style with more keys but using less space on the screen.
I think it could be related to some configuration on the project. I have tried the same textview but on a new empty project and I'm getting the new keyboard layout.
This is the current textview configuration (yes, it's an old project that uses xib files)
Do you know what I need to get the new keyboard style on my app?
As #Larme has said, the application was not optimized for iPhone 6/plus. Adding the following image size to the launch image was enough:
Default-667h#2x.png: 750 x 1334 (iPhone 6, Portrait)
Default-736h#3x.png: 1242 x 2208 (iPhone 6 Plus, Portrait)

How to get host app screen geometry for iOS 8 custom keyboard inside iPhone app running on iPad?

My Custom keyboard has presets for each screen resolution of all Apple devices. So I have iphone, iphon5, iphone6, iphone6plus and ipad presets.
But in case user runs iPhone app (like instagram) on iPad, I need to load iphone keyboard preset and use its geometry.
Also iPhone 6 and 6+ can use stretched mode, when apps run like iPhone 5 app being stretched.
So determining UI_USER_INTERFACE_IDIOM is not a solution.
Keyboard extension and host app can see screen geometry in different ways, so I am stuck here. Need to get at least application frame for host app or any other explicit way to get that geometry.
App and keyboard extension see geometry different ways:
Also Swift key seems to have same bug while running hosted inside of iphone app on ipad screen.
Swiftkey inside iphone app on ipad:
I just found a way to check isPad on keyboard extension but I cannot make sure it is best way.
UI_USER_INTERFACE_IDIOM() && YourKeyboardViewController.instance.view.bounds.size.width == UIScreen.mainScreen.bounds.size.width
You should do this after YourKeyboardViewController.instance did called viewWillAppear(), after that the view.bounds did changed to 320x480 from 768x1024.

iOS Replace the default Keyboard with a shorter Keyboard

How can I get the default keyboard to be shorter like the keyboard on the right?
The standard keyboard is the left, how do I get it to have the height of the one on the right?
The left keyboard is not taller than the right keyboard— they are the same height, in points. The difference is in the scale of the screen; i.e. the pixels are smaller on the right. Assuming that these are the same device, the difference is caused by one of two things:
The app on the left is not updated to support the higher resolution screens of the iPhone 6 and 6+. To remedy this, you can either specify a .xib as your "Launch Screen File" in the target's General settings, or add a launch image for iPhone 6 and 6+ to your asset catalog.
The app on the left is running on a device which is in "Zoomed" view mode. To change this, follow this path in your Settings app: General > Display & Brightness > View.
Edit: A good tip for recognizing such resolution differences (on an iPhone 6 or 6+) is to watch the clock as an app launches. If it gets bigger, then your device is set to the "Standard" view mode, and the application has not been updated to support iPhone 6/6+ resolutions. If the clock stays the same size, then either the app has been updated to support iPhone 6, or the device is in the "Zoomed" view mode (or both).
You cannot control the height of the keyboard. The keyboard on the left is looks taller because this app hasn't been updated for iPhone 6/6+ screens, so the keyboard and everything else in the app has been stretched.
See this question for how to support the new 6 screen sizes.

How can I tell if a Springs and Struts app is scaling in the iPhone 6 simulator?

I have a couple applications built pre-auto-layout (but w/ Springs and Struts to support iPhone 5+) that I'm trying out in the iPhone 6 and 6 Plus simulator and they actually look quite good. However, I can't tell if the Springs and Struts are actually doing their job so-to-speak or if they're just being scaled. There must be some obvious thing I'm missing where it says which? Also, do auto-layout apps just automatically convert when recompiled with the latest SDK for iPhone 6 so they're not just scaling as long as 3X artwork is provided (in the case of 6 Plus)?
You can easily see, if your app runs in scaled mode by outputting the bounds and the native bounds screen of the main screen:
println("bounds = \(UIScreen.mainScreen().bounds)")
println("nativeBounds = \(UIScreen.mainScreen().nativeBounds)")
Without a designated launch images the output of the iPhone 6 Plus Simulator is:
bounds = (0.0,0.0,320.0,480.0)
nativeBounds = (0.0,0.0,960.0,1440.0)
The native bounds are 3 times the scaled bounds. This is the reason behind the #3x display.scale.
In case of the iPhone 6 Plus nativeScale also helps:
println("main screen native scale = \(UIScreen.mainScreen().nativeScale)")
println("main screen scale = \(UIScreen.mainScreen().scale)")
nativeScale will always be 3.0. scale will be 2.0 if the simulator does scaling.
To get a comprehensive understanding of the new resolutions see this great blog entry: http://www.paintcodeapp.com/news/iphone-6-screens-demystified
Use a different launch image for iPhone 6, iPhone 6 Plus and all the rest.
If you see a specific lunch image you know your app is not scaled and that it is running in the device's native resolution.
The only way I was able to tell was to go home and see if the status bar text was smaller than it was in my app. A smaller home screen status bar implies it is being scaled. If the status bar text is the same size within your app in the iPhone 6 sim as it is on the home screen of the simulator, then it is using your springs/struts or autolayout instead of scaling

Resources