/SMInstagramPhotoPicker

SMInstagramPhotoPicker, A instagram photos picker viewcontroller using swift 3.1.

Primary LanguageSwiftMIT LicenseMIT

SMInstagramPhotoPicker Create By Sweetman, Inc

Version License Platform

If you like this framework. Please give me a start.

Features

  • Same design as Instagram and animation.
  • So easy to use.
  • Support Swift 3.1
  • Performances!
  • Use GCD and ARC

Requirements

  • iOS 10.3 or later
  • Xcode 8.3 or later
  • swift 3.1

Getting Started

Installation

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

pod "SMInstagramPhotoPicker"
import SMInstagramPhotoPicker

Use

  • In your controller.
var picker: SMPhotoPickerViewController?
  • First. It is importance to do this step.

  • Be sour your app have Authorization to assecc your photo library.

  • on your plist.info add one attrabute.

kye: Privacy - Photo Library Usage Description
String: Your app need assecc your photo library.
  • And then request Authorization.
PHPhotoLibrary.requestAuthorization { (status) in
if status == .authorized {
	self.picker = SMPhotoPickerViewController()
		self.picker?.delegate = self
	}
}
  • Show!!!
//show picker. You need use present.
@IBAction func show(_ sender: UIButton) {
    if picker != nil {
        present(picker!, animated: true, completion: nil)
    }
}
  • Get your image through deledate.
class ViewController: UIViewController, SMPhotoPickerViewControllerDelegate {
	//your viewcontroller

    func didCancelPickingPhoto() {
        print("User cancel picking image")
    }
    
    
    func didFinishPickingPhoto(image: UIImage, meteData: [String : Any]) {
        
        imageView.image = image
    }
}

Licenses

All source code is licensed under the MIT License.

Author