본문 바로가기
Programming/iPhone

UIDevice의 userInterfaceIdiom

by 유주원 2012. 12. 24.

UIDevice의 userInterfaceIdiom은 현재 디바이스가 ipad인지 iphone인지를 구분시켜주는 프로퍼티.

해당 값이 UIUserInterfaceIdiomPad 이면 ipad

UIUserInterfaceIdiomPhone이면 iphone을 나타낸다.


if ([UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){

// 아이 패드

}