문서 (17)
-
- UIColor 확장클래스 랜덤으로 색상뽑아내기
- extension UIColor { class func randomColor() -> UIColor { let red = CGFloat(drand48()) let green = CGFloat(drand48()) let blue = CGFloat(drand48()) return UIColor(r...
-
- 아이폰에서 음소거(침묵모드, 뮤트모드) 상태인지 확인하는 방법
- + (BOOL)isDeviceMute { UInt32 cfRouteSize = sizeof (CFStringRef); CFStringRef cfRoute; NSString* nsRoute; AudioSessionGetProperty( kAudioSessionProperty_AudioRoute, &cfRouteSize, &cfRoute); nsR...
-
- Xcode에 설치된 모든 SDK 버전 확인방법
- xcodebuild -showsdks // 결과 // OS X SDKs: // OS X 10.9 -sdk macosx10.9 // OS X 10.10 -sdk macosx10.10 // // iOS SDKs: // iOS 8.3 -sdk iphoneos8.3 // // iOS Simulator SDKs: // Simulator - iOS 8.3 -...
-
- Xcode 설치 경로 확인 및 변경방법
- #### Xcode 설치 경로 확인 명령어 ### xcode-select -p // 결과 : Applications/Xcode.app/Contents/Developer #### Xcode 설치 경로 변경 ### sudo xcode-select -s path
-
- 스크린 사이즈로 아이폰 6, 아이폰6 Plus 인지 알아내기
- #define iPhone6 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && MAX([UIScreen mainScreen].bounds.size.height,[UIScreen mainScreen].bounds.size.width) == 667) #def...
-
- 스크린 캡쳐 (전원버튼 + 홈버튼) 호출 알아내기 [2]
- // 오브젝티브씨 코드 NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification object:nil queue...
-
- NSURL에 한글이 포함된 url을 사용시 에러방지법 [2]
- // urlString 에 영문이 아닌 한국어나 일어 등을 포함된 url을 사용할때 아래와 같이 사용하면 에러가 발생. [NSURL URLWithString:urlString]; // 이렇게 인코딩해서 사용. 끝~ [NSURL URLWithString:[urlString st...
-
- #define 스크린 넓이 [1]
- #define SCREEN_WIDTH ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPo...
-
- 아이폰 카메라롤에 사진 지우기
- ALAssetsLibrary *assetLibrary = [ALAssetsLibrary new]; [assetLibrary enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { [group enumerateAssetsUsingBlock...
-
- iOS 시스템 오디오 파일 리스트 출력하기
- NSMutableArray *audioFileList = [[NSMutableArray alloc] init]; NSFileManager *fileManager = [[NSFileManager alloc] init]; NSURL *directoryURL = [NSURL URLWithString:@"/System/Library/Audio/UISounds"];...