2

As a follow up question to this one, I'm wondering if you're able to detect (in an iOS app or application extension) if the app has not been updated for the new screen sizes and is running in 'zoomed' mode or not.

I know there are [UIScreen mainScreen].nativeScale and [UIScreen mainScreen].scale but so far I haven't been able to detect this context between an app that has been properly updated and one that hasn't and is running zoomed.

Does anyone know of a mechanism to do this?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
barfoon
  • 27,481
  • 26
  • 92
  • 138
  • There's a guide, but its for Swift. the part (Pinch and Rotation Gestures) is for scaling so you could monitor that. -- http://www.raywenderlich.com/76020/using-uigesturerecognizer-with-swift-tutorial -- you might be in luck, there an older tutorial using Obective C -- http://www.raywenderlich.com/6567/uigesturerecognizer-tutorial-in-ios-5-pinches-pans-and-more – Tasos Sep 22 '14 at 06:10
  • I also asked similar question - http://stackoverflow.com/questions/26945373/how-to-detect-if-ios8-custom-keyboard-extension-is-running-in-not-iphone-6-optim – samir105 Nov 22 '14 at 10:08

1 Answers1

1

In order to detect whether the host app is running in zoom mode from within a keyboard extension, use self.view.frame.size.width It returns 320 when the app is in zoomed mode & 414 for standard mode on my 6+

Jeet
  • 1,030
  • 2
  • 10
  • 20
  • This answer used to be correct. However since not sure when it width does not return 320 anymore, it rather returns device width 375 for iPhone6 and 414 for 6 Plus. – Ahmet Akkök Dec 11 '17 at 21:18