Skip to content

Commit

Permalink
Bump to v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
congnd committed Oct 11, 2020
1 parent b683168 commit fccd843
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion FMPhotoPicker.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@version = "1.2.0"
@version = "1.3.0"

Pod::Spec.new do |s|
s.name = "FMPhotoPicker"
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elega
### SwiftPM
```
dependencies: [
.package(url: "https://github.com/congnd/FMPhotoPicker.git", .exact("1.2.0")),
.package(url: "https://github.com/congnd/FMPhotoPicker.git", .exact("1.3.0")),
]
```

Expand All @@ -45,10 +45,10 @@ and run `carthage update FMPhotoPicker`

### CocoaPods
FMPhotoPicker is now available in [CocoaPods](https://cocoapods.org/pods/FMPhotoPicker)
You want to add pod 'FMPhotoPicker', '~> 1.2.0' similar to the following to your Podfile:
You want to add pod 'FMPhotoPicker', '~> 1.3.0' similar to the following to your Podfile:
```
target 'MyApp' do
pod 'FMPhotoPicker', '~> 1.2.0'
pod 'FMPhotoPicker', '~> 1.3.0'
end
```
Then run a `pod install` inside your terminal.
Expand Down Expand Up @@ -76,11 +76,14 @@ self.present(editor, animated: true)
```

## Delegation methods
- Implement FMPhotoPickerViewControllerDelegate protocol to handle selected images
- Implement FMPhotoPickerViewControllerDelegate protocol to handle selected photos.
```swift
func fmPhotoPickerController(_ picker: FMPhotoPickerViewController, didFinishPickingPhotoWith photos: [UIImage])
func fmPhotoPickerController(_ picker: FMPhotoPickerViewController, didFinishPickingPhotoWith assets: [PHAsset])
```

***If you prefer to receive selected photos in type of `PHAsset` instead of `UIImage` then don't forget to set the `shouldReturnAsset` to `true` and implement the corresponding delegation method.***

- Implement FMImageEditorViewControllerDelegate protocol to handle ouput image
```swift
func fmImageEditorViewController(_ editor: FMImageEditorViewController, didFinishEdittingPhotoWith photo: UIImage)
Expand All @@ -96,6 +99,7 @@ func fmImageEditorViewController(_ editor: FMImageEditorViewController, didFinis
- [`availableCrops`](#ref-available-crops)
- [`useCropFirst`](#ref-use-crop-first)
- [`alertController`](#ref-alert-controller)
- [`shouldReturnAsset`](#ref-should-return-asset)
- [`forceCropEnabled`](#ref-force-crop-enabled)
- [`eclipsePreviewEnabled`](#ref-eclipse-preview-enabled)
- [`strings`](#ref-strings)
Expand Down Expand Up @@ -133,18 +137,24 @@ FMPhotoEditor provides some default crops that will be fit to you.
Type: `[FMCroppable]?`
Default: all crops provided by FMPhotoPicker.

***You are not allowed to use the editor without giving it at least one crop option or one filter option***

- <a name="ref-use-crop-first"></a>`useCropFirst`
An option that indicates whether the crop menu should be selected by default in the `FMImageEditorViewController`.
Type: `Bool`
Default: `false`

***You are not allowed to use the editor without giving it at least one crop option or one filter option***

- <a name="ref-alert-controller"></a>`alertController`
An alert controller to show the confirmation view to an user with 2 options: Ok or Cancel.
Type: `FMAlertable`
Default: `FMAlert`

- <a name="ref-should-return-asset"></a>`shouldReturnAsset`
Whether you want FMPhotoPicker returns PHAsset instead of UIImage.
***FMPhotoPicker chooses a proper delegation method to be invoked when user finishes picking based on this configuration***
Type: `Bool`
Default: `false`

- <a name="ref-forc-crop-enabled"></a>`forceCropEnabled`
A bool value that indicates whether force mode is enabled.
If `true` is set, only the first crop in the `availableCrops` is used in the editor.
Expand Down

0 comments on commit fccd843

Please sign in to comment.