Latest 1.0.4
Homepage https://github.com/mvetoshkin/MVImagePicker
License MIT
Platforms ios 8.0
Dependencies SnapKit
Frameworks UIKit, Photos
Authors

CI Status
Version
License
Platform

1
2

Features

  • Multiple selection
  • Switching between albums
  • Taking photos

Usage

You can do the next steps to use MVImagePicker:

let ctrl = ImagePickerViewController()

ctrl.delegate = self
ctrl.multipleSelection = false
ctrl.scrollDelegate = self

self.view.addSubview(ctrl.view)
self.addChildViewController(ctrl)

MVImagePicker has several delegate methods:

1. ImagePickerViewControllerDelegate protocol

optional func imagePickerViewControllerDidEnabled(viewController: ImagePickerViewController, isAuthorized: Bool)

This delegate is used when user permits access to the photos on the device

optional func imagePickerViewControllerLibraryDidSelect(viewController: ImagePickerViewController)

This delegate is used when user clicks on the library icon in the top of the MVImagePicker controller

optional func imagePickerViewControllerAlbumOpened(viewController: ImagePickerViewController, album: PHAssetCollection)

This delegate method is used when user opens a library

optional func imagePickerViewControllerBeforeAssetChanged(viewController: ImagePickerViewController)
optional func imagePickerViewControllerAfterAssetChanged(viewController: ImagePickerViewController)

These 2 delegate methods are used before and after user adds a new asset into the library

func imagePickerViewControllerAssetDidCreate(viewController: ImagePickerViewController, asset: PHAsset, locally: Bool)
func imagePickerViewControllerAssetDidRemove(viewController: ImagePickerViewController, asset: PHAsset)

These 2 delegate methods are used when an asset is created or removed from the library (even using Photos or some another app)

func imagePickerViewControllerAssetDidSelect(viewController: ImagePickerViewController, asset: PHAsset, cell: ImagePickerPhotoCell)
func imagePickerViewControllerAssetDidDeselect(viewController: ImagePickerViewController, asset: PHAsset, cell: ImagePickerPhotoCell)

These 2 delegate methods are used when user selects or deselects an asset in the library

optional func imagePickerViewControllerAssetDidLongTap(viewController: ImagePickerViewController, asset: PHAsset, cell: ImagePickerPhotoCell)

This delegate method is used when user does a long tap on any asset in the library

2. ImagePickerViewControllerScrollDelegate protocol

optional func imagePickerViewControllerWillBeginDragging(scrollView: UIScrollView)
optional func imagePickerViewControllerDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool)
optional func imagePickerViewControllerDidScroll(scrollView: UIScrollView)

These 3 delegates are just wrappers for standard scrollViewWillBeginDragging, scrollViewDidEndDragging and
scrollViewDidScroll, and they are used for photos collection view

Requirements

iOS 8 or above

Installation

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

pod "MVImagePicker"

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

Mikhail Vetoshkin, [email protected]

License

MVImagePicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "MVImagePicker",
    "version": "1.0.4",
    "summary": "MVImagePicker allows you to inject the photo library to your app",
    "description": "MVImagePicker allows you to inject the photo library to your app and to pick images from it.nThat is an attempt to create instagram-like image picker.",
    "homepage": "https://github.com/mvetoshkin/MVImagePicker",
    "screenshots": [
        "https://cloud.githubusercontent.com/assets/882141/16874775/578cd18e-4aac-11e6-802e-dc614d92a52e.PNG",
        "https://cloud.githubusercontent.com/assets/882141/16874806/7c261190-4aac-11e6-9103-19fb6d21965a.PNG"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Mikhail Vetoshkin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mvetoshkin/MVImagePicker.git",
        "tag": "1.0.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MVImagePicker/Classes/**/*",
    "resource_bundles": {
        "MVImagePicker": [
            "MVImagePicker/Assets/**/*.png"
        ]
    },
    "frameworks": [
        "UIKit",
        "Photos"
    ],
    "dependencies": {
        "SnapKit": []
    }
}

Pin It on Pinterest

Share This