Latest 1.0.2
Homepage https://github.com/Mark-Ma-1988/PhotoSolution
License MIT
Platforms ios 9.0, requires ARC
Authors

PhotoSolution

Version
License
Platform
Swift

Features

  • 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.

Installation

PhotoSolution is available through CocoaPods. To install
it, simply add the following line to your Podfile:

use_frameworks!

and then add:

pod 'PhotoSolution'

Related Permissions (Your need to add them in Info.plist firstly)

  • Privacy – Photo Library Usage Description
  • Privacy – Photo Library Additions Usage Description
  • Privacy – Camera Usage Description

Basic Usage

Objective-C

//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
}

Swift

//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
}
}

Customization (optional)

Objective-C

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;

Swift

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

Author

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).

License

MIT

Latest podspec

{
    "name": "PhotoSolution",
    "version": "1.0.2",
    "summary": "PhotoSolution is an all-in-one photo solution for your iOS app, the UI is similar to WeChat",
    "homepage": "https://github.com/Mark-Ma-1988/PhotoSolution",
    "license": "MIT",
    "authors": {
        "Mark Ma": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Mark-Ma-1988/PhotoSolution.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "9.0"
    },
    "module_name": "PhotoSolution",
    "source_files": "PhotoSolution/*.{swift}",
    "swift_version": "4.2",
    "requires_arc": true,
    "resource_bundles": {
        "PhotoSolution": [
            "PhotoSolution/*.{xib,png,storyboard}"
        ]
    }
}

Pin It on Pinterest

Share This