diff --git a/README.md b/README.md index ca51821..768bfa3 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,20 @@ NohanaImagePicker enables your app to pick images from multiple album, and the m ## Usage ```swift +import UIKit +import Photos import NohanaImagePicker -class ViewController: UIViewController, NohanaImagePickerControllerDelegate { +class MyViewController: UIViewController { + let picker = NohanaImagePickerController() override func viewDidAppear(animated: Bool) { - super.viewDidAppear(true) - let picker = NohanaImagePickerController() - picker.delegate = self - present(picker, animated: true, completion: nil) + super.viewDidAppear(animated) + self.picker.delegate = self + present(self.picker, animated: true, completion: nil) } +} + +extension MyViewController: NohanaImagePickerControllerDelegate { func nohanaImagePickerDidCancel(_ picker: NohanaImagePickerController) { print("🐷Canceled🙅") @@ -30,7 +35,6 @@ class ViewController: UIViewController, NohanaImagePickerControllerDelegate { print("🐷Completed🙆\n\tpickedAssets = \(pickedAssts)") picker.dismiss(animated: true, completion: nil) } - } ``` @@ -84,6 +88,8 @@ Use [Carthage](https://github.com/Carthage/Carthage). Use [CocoaPods](https://cocoapods.org/). +- Try; ``pod try NohanaImagePicker`` + - Add the followings to your Podfile: ```ruby