- Take photo and pick multiple images (you can set maximum amount) from the local photo library
- Support both Objective-C and Swift
- Browse all the albums
- View, expand and edit an image in its original size
- Compress images
- Comtomize some UI properties, like color and title.
- AutoLayout, support both portrait and landscape for all the different screen sizes.
PhotoSolution is available through CocoaPods. To install it, simply add the following line to your Podfile:
use_frameworks!
and then add:
pod 'PhotoSolution'
- Privacy - Photo Library Usage Description
- Privacy - Photo Library Additions Usage Description
- Privacy - Camera Usage Description
//import it
@import PhotoSolution;
//define delegate
@interface YourViewController () <PhotoSolutionDelegate>
//initilize
PhotoSolution* photoSolution = [[PhotoSolution alloc] init];
photoSolution.delegate = self;
//take photo
[self presentViewController: [photoSolution getCamera] animated:YES completion:nil];
//pick photos from local library and define maximum picking amount, like 9
[self presentViewController: [photoSolution getPhotoPickerWithMaxPhotos:9] animated:YES completion:nil];
//implement delegate method
-(void)returnImages:(NSArray *)images{
// deal with the return images
}
-(void)pickerCancel{
// when user cancel picking photo
}
//import it
import PhotoSolution
//initilize
let photoSolution = PhotoSolution()
photoSolution.delegate = self
//take photo
self.present(photoSolution.getCamera(), animated: true, completion: nil)
//pick photos from local library and define maximum picking amount, like 9
self.present(photoSolution.getPhotoPicker(maxPhotos: 9), animated: true, completion: nil)
//implement delegate method
extension YourViewController: PhotoSolutionDelegate{
func returnImages(_ images: [UIImage]) {
// deal with the return images
}
func pickerCancel() {
// when user cancel
}
}
photoSolution.customization.markerColor = [UIColor colorWithRed:0.14 green:0.72 blue:0.30 alpha:1.0];
photoSolution.customization.navigationBarBackgroundColor = UIColor.darkGrayColor;
photoSolution.customization.navigationBarTextColor = UIColor.whiteColor;
photoSolution.customization.titleForAlbum = @"Album";
photoSolution.customization.alertTextForPhotoAccess = @"Your App Would Like to Access Your Photos";
photoSolution.customization.settingButtonTextForPhotoAccess = @"Setting";
photoSolution.customization.cancelButtonTextForPhotoAccess = @"Cancel";
photoSolution.customization.alertTextForCameraAccess = @"Your App Would Like to Access Your Photos";
photoSolution.customization.settingButtonTextForCameraAccess = @"Setting";
photoSolution.customization.cancelButtonTextForCameraAccess = @"Cancel";
photoSolution.customization.returnImageSize = ReturnImageSizeCompressed;
photoSolution.customization.statusBarColor = StatusBarColorWhite;
photoSolution.customization.markerColor = UIColor(red:0.14, green:0.72, blue:0.30, alpha:1.0)
photoSolution.customization.navigationBarBackgroundColor = UIColor.darkGray
photoSolution.customization.navigationBarTextColor = UIColor.white
photoSolution.customization.titleForAlbum = "Album"
photoSolution.customization.alertTextForPhotoAccess = "Your App Would Like to Access Your Photos"
photoSolution.customization.settingButtonTextForPhotoAccess = "Setting"
photoSolution.customization.cancelButtonTextForPhotoAccess = "Cancel"
photoSolution.customization.alertTextForCameraAccess = "Your App Would Like to Access Your Photos"
photoSolution.customization.settingButtonTextForCameraAccess = "Setting"
photoSolution.customization.cancelButtonTextForCameraAccess = "Cancel"
photoSolution.customization.returnImageSize = .compressed
photoSolution.customization.statusBarColor = .white
Mark Ma, a software developer focused on mobile application solution, including server side backend development (restful API, database, AWS deployment) and client side app development (iOS && Android).
MIT