KazimAhmad / YPImagePicker

๐Ÿ“ธ Instagram-like image picker & filters for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YPImagePicker

YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It comes with adjustable square crop and filters.

Version Platform CI Status Carthage compatible codebeat badge Release version

Features
๐ŸŒ… Library
๐Ÿ“ท Photo
๐ŸŽฅ Video
โœ‚๏ธ Crop
โšก๏ธ Flash
๐Ÿ–ผ Filters

Preview

Those features are available just with a few lines of code!

Improvements

YPImagePicker was built from the great Fusuma library.

Here are the improvements we added :

  • Improve Overall Code Quality
  • Simplify API
  • Added Filters View ala Instagram
  • Replaces icons with lighter Text
  • Preselect Front camera (e.g for avatars)
  • Scroll between tabs which feels smoother
  • Grab videos form the library view as well
  • Replaces Delegate based with callbacks based api
  • Uses Native Navigation bar over custom View (gotta be a good UIKit citizen)

Installation

Drop in the Classes folder to your Xcode project.
You can also use CocoaPods or Carthage.

Using CocoaPods

Add pod 'YPImagePicker' to your Podfile and run pod install. Also add use_frameworks! to the Podfile.

target 'MyApp'
pod 'YPImagePicker'
use_frameworks!

Using Carthage

Add github "Yummypets/YPImagePicker" to your Cartfile and run carthage update. If unfamiliar with Carthage then checkout their Getting Started section.

github "Yummypets/YPImagePicker"

Plist entries

In order for your app to access camera and photo libraries, you'll need to ad these plist entries :

  • Privacy - Camera Usage Description (photo/videos)
  • Privacy - Photo Library Usage Description (library)
  • Privacy - Microphone Usage Description (videos)

Usage

import YPImagePicker then use the following:

let picker = YPImagePicker()
// picker.onlySquareImages = true
// picker.showsFilters = false
// picker.startsOnCameraMode = true
// picker.usesFrontCamera = true
// picker.showsVideo = true
picker.didSelectImage = { img in
    // image picked
}
picker.didSelectVideo = { videoData in
    // video picked
}
present(picker, animated: true, completion: nil)

Original Project & Author

This project has been first inspired by Fusuma Considering the big code and design changes, this moved form a fork to a standalone separate repo, also for discoverability purposes. Original Fusuma author is ytakz

License

YPImagePicker is released under the MIT license.
See LICENSE for details.

Swift Version

Swift 3 -> version 1.2.1
Swift 4 -> version 2.0.0

About

๐Ÿ“ธ Instagram-like image picker & filters for iOS

License:MIT License


Languages

Language:Swift 98.8%Language:Ruby 0.7%Language:Objective-C 0.5%