일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 앱리소스
- fido
- OTP
- SwiftUI
- WebAuthn
- otpkey
- MYSQL
- Android
- 2FA
- kmip
- appres
- OSX
- 앨범북
- git
- apple
- SSL
- 애플
- Xcode
- Nodejs
- SSH
- openssl
- 안드로이드
- FIDO2
- 앱스토어
- 인증
- albumbook
- MSYS2
- SWIFT
- css
- MFA
Archives
- Today
- Total
인디노트
[iOS] 이미지, 동영상을 카메라 롤에 저장 본문
이미지
1 2 3 4 5 6 7 8 9 10 11 12 13 | UIImage *image = [info objectForKey: UIImagePickerControllerOriginalImage ]; // 이미지를 카메라 롤에 저장 UIImageWriteToSavedPhotosAlbum (image, self , @selector (image:didFinishSavingWithError:contextInfo:), nil ); // 저장한 이후에 실행 될 메소드 - ( void )image:( UIImage *)image didFinishSavingWithError:( NSError *)error contextInfo:( void *)contextInfo { if (error) { NSLog (@ "error: %@" , [error localizedDescription]); } else { NSLog (@ "saved" ); } } |
동영상
1 2 3 4 5 6 7 8 9 10 11 12 13 | NSURL *mediaUrl = [info objectForKey: UIImagePickerControllerMediaURL ]; // 동영상을 카메라 롤에 저장 UISaveVideoAtPathToSavedPhotosAlbum ([mediaUrl path], self , @selector (video:didFinishSavingWithError:contextInfo:), nil ); // 저장한 이후에 실행 될 메소드 - ( void )video:( NSString *)videoPath didFinishSavingWithError:( NSError *)error contextInfo:( void *)contextInfo { if (error) { NSLog (@ "error: %@" , [error localizedDescription]); } else { NSLog (@ "saved" ); } } |
'소스 팁 > Objective C, Swift, iOS, macOS' 카테고리의 다른 글
Working with HEIF and HEVC (0) | 2018.12.28 |
---|---|
MBCircularProgressBar (今回の概要) (0) | 2018.08.28 |
[Objective-c] NSRunLoop이 플래그가 설정되기를 기다리는 가장 좋은 방법은 무엇입니까? (0) | 2018.06.09 |
iOS 10에서 Privacy 설정 (0) | 2018.06.05 |
PHFetchOptions (0) | 2018.04.29 |
Comments