Hyung
Here is a super message about detecting device / screen size.
How to detect iPhone 5 (widescreen devices)?
This is my favorite suggestion, click on it and thank the real author!
Add new Swift file -> AppDelegateEx.swift
add extension to AppDelegate
import UIKit extension AppDelegate { class func isIPhone5 () -> Bool{ return max(UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height) == 568.0 } class func isIPhone6 () -> Bool { return max(UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height) == 667.0 } class func isIPhone6Plus () -> Bool { return max(UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height) == 736.0 } }
using:
if AppDelegate.isIPhone5() { collectionViewTopConstraint.constant = 2 }else if AppDelegate.isIPhone6() { collectionViewTopConstraint.constant = 20 }
Combine it with the font settings in your application, which you probably should be doing right now?
variable.font = UIFont(name: "Palatino", size: 24)
source share