Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Как определить размер экрана iPhone и задать действия в зависимости от этого размера.
if UIDevice().userInterfaceIdiom == .phone {
switch UIScreen.main.nativeBounds.height {
case 1334:
// iPhone 6,7,8, 6S, 7S, 8S
case 1920,2208:
// iPhone 8Plus
case 2436:
// iPhone X, XS
case 2688:
// iPhone XS Max
case 1792:
// iPhone XR
print("iPhone 4,4S,5,5S")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.