From a2dbfcf821b3cf9b2cb30d878f7fe52e483fb244 Mon Sep 17 00:00:00 2001 From: S4cha Date: Wed, 18 Oct 2017 17:48:37 +0200 Subject: [PATCH] Updates README --- README.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 427d89126..2736dbc52 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,9 @@ you'll need to ad these `plist entries` : yourWording ``` -## Usage - -`import YPImagePicker` then use the following: +## Configuration ```swift -// Configuration var config = YPImagePickerConfiguration() config.onlySquareImages = false config.libraryTargetImageSize = .original @@ -101,13 +98,26 @@ config.shouldSaveNewPicturesToAlbum = true config.videoCompression = AVAssetExportPresetHighestQuality config.albumName = "MyGreatAppName" -// Set it the default conf for all Pickers -// YPImagePicker.setDefaultConfiguration(config) +// Build a picker with your configuration +let picker = YPImagePicker(configuration: config) +``` + +## Default Configuration + +```swift +// Set the default configuration for all pickers +YPImagePicker.setDefaultConfiguration(config) + // And then use the default configuration like so: -// let picker = YPImagePicker() +let picker = YPImagePicker() +``` -// Here we use a per picker configuration. -let picker = YPImagePicker(configuration: config) +## Usage + +`import YPImagePicker` then use the following: + +```swift +let picker = YPImagePicker() // unowned is Mandatory since it would create a retain cycle otherwise :) picker.didSelectImage = { [unowned picker] img in