ytakzk / Fusuma
- воскресенье, 20 марта 2016 г. в 02:12:32
 
Swift
Instagram-like photo browser and a camera feature with a few line of code in Swift.
Fusuma is a Swift library that provides an Instagram-like photo browser and a camera feature with a few line of code.
You can use Fusuma instead of UIImagePickerController. It also has a feature to take a square-sized photo.
Those features are available just with a few lines of code!
Drop in the Classes folder to your Xcode project.
You can also use cocoapods or Carthage.
Add pod 'Fusuma' to your Podfile and run pod install. Also add use_frameworks! to the Podfile.
use_frameworks!
pod 'Fusuma'
Add github "ytakzk/Fusuma" to your Cartfile and run carthage update. If unfamiliar with Carthage then checkout their Getting Started section.
github "ytakzk/Fusuma"
Import Fusuma import Fusuma then use the following codes in some function except for viewDidLoad and give FusumaDelegate to the view controller.  
let fusuma = FusumaViewController()
fusuma.delegate = self
self.presentViewController(fusuma, animated: true, completion: nil)// Return the image which is selected from camera roll or is taken via the camera.
func fusumaImageSelected(image: UIImage) {
  print("Image selected")
}
// Return the image but called after is dismissed.
func fusumaDismissedWithImage(image: UIImage) {
  print("Called just after FusumaViewController is dismissed.")
}
// When camera roll is not authorized, this method is called.
func fusumaCameraRollUnauthorized() {
  print("Camera roll unauthorized")
}fusumaTintColor: UIColor // tint color
fusumaBackgroundColor: UIColor // background colorytakzk
http://ytakzk.me
Your support is welcome through Bitcoin 16485BTK9EoQUqkMmSecJ9xN6E9nhW8ePd
Fusuma is released under the MIT license.
See LICENSE for details.