Skip to content

Commit

Permalink
Updates README
Browse files Browse the repository at this point in the history
  • Loading branch information
s4cha committed Oct 18, 2017
1 parent 2002cf3 commit a2dbfcf
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,9 @@ you'll need to ad these `plist entries` :
<string>yourWording</string>
```

## Usage

`import YPImagePicker` then use the following:
## Configuration

```swift
// Configuration
var config = YPImagePickerConfiguration()
config.onlySquareImages = false
config.libraryTargetImageSize = .original
Expand All @@ -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
Expand Down

0 comments on commit a2dbfcf

Please sign in to comment.