Skip to content

Instantly share code, notes, and snippets.

@amirhanov
Created May 31, 2019 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirhanov/564e71e42684043f9a11e00ff0e6252e to your computer and use it in GitHub Desktop.
Save amirhanov/564e71e42684043f9a11e00ff0e6252e to your computer and use it in GitHub Desktop.
Как определить размер экрана iPad и задать действия в зависимости от этого размера.
if UIDevice().userInterfaceIdiom == .pad {
switch UIScreen.main.nativeBounds.height {
case 2048:
// iPad Air 2, Pro 9,7
case 2224:
// iPad Pro 10,5
case 2388:
// iPad Pro 11
case 2732:
// iPad Pro 12,9
default:
print("iPad Air1 , Mini 1- 4")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment