Skip to content

Latest commit

 

History

History
80 lines (64 loc) · 2.93 KB

README.md

File metadata and controls

80 lines (64 loc) · 2.93 KB

PhotoPicker

📷A image picker for iOS , written by Swift.(support preview the image)

refer: teambition/PhotoPicker

GIF

image

How To Get Started

Carthage

Specify "PhotoPicker" in your Cartfile:

github "StormXX/PhotoPicker"

DEMO

run carthage update to fetch the PhotoBrowser. Becaust this PhotoPicker support previewing the photo

Usage

configuration properties

//MARK: - public property
open weak var delegate: PhotoPickerDelegate?
open var assetCollectionSubtypes: [PHAssetCollectionSubtype]?
open var allowMultipleSelection: Bool = true
open var minimumNumberOfSelection: Int = 1
open var maximumNumberOfSelection: Int = 9
open var mediaType: PhotoPickerMediaType = .any
open var prompt: String?

Implement delegate

func photoPickerController(controller: PhotoPickerController, didFinishPickingAssets assets: [PHAsset], needHighQualityImage: Bool)
func photoPickerControllerDidCancel(controller: PhotoPickerController)
func photoPickerController(controller: PhotoPickerController, shouldSelectAsset asset: PHAsset) -> Bool
func photoPickerController(controller: PhotoPickerController, didSelectAsset asset: PHAsset)
func photoPickerController(controller: PhotoPickerController, didDeselectAsset asset: PHAsset)

Present PhotoPicker

let photoPickerController = PhotoPickerController()
photoPickerController.delegate = self
presentViewController(photoPickerController, animated: true, completion: nil)

Localization

let localizedString: [String: String] = [
    "PhotoPicker.Cancel": LocalizationString("PhotoPicker.Cancel"),
    "PhotoPicker.OK": LocalizationString("PhotoPicker.OK"),
    "PhotoPicker.Send": LocalizationString("PhotoPicker.Send"),
    "PhotoPicker.Origin": LocalizationString("PhotoPicker.Origin"),
    "PhotoPicker.MaximumNumberOfSelection.Alert": LocalizationString("PhotoPicker.MaximumNumberOfSelection.Alert"),
    "PhotoPicker.Photos": LocalizationString("PhotoPicker.Photos"),
    "PhotoPicker.Videos": LocalizationString("PhotoPicker.Videos"),
    "PhotoPicker.Title" : LocalizationString("PhotoPicker.Title"),
    "PhotoPicker.VideoSelect.Alert": LocalizationString("PhotoPicker.VideoSelect.Alert")
]

Similar

Minimum Requirement

  • iOS 8.0

Release Notes

License

  • PhotoPicker is released under the MIT license. See LICENSE for details.

More Info