Assume iPhone 6 Plus display is in standard mode (Settings > Display > View > Standard), the UIInputViewController inputView of a keyboard extension returns different widths depends on whether the host app is optimised for the iPhone 6/iPhone 6 Plus screen.
For example, the built-in Notes app returns width as 414 points (not zoomed), where the LINE app (as of v4.7.2) returns 320 points (zoomed).
How can a keyboard extension determine the width of the host app window (say, in viewDidLoad, before viewDidiLoad)?
You can use the defined macros:
Or
[UIScreen mainScreen].nativeScalewitch will gives you2.6fif normal, and2.8fif zoomed on iPhone 6 plus