Marshallino16 ImageCropper Save

Simple ratio based image cropper for SwiftUI

Project README

SwiftUI-ImageCropper

GitHub tag (latest by date) Swift Package Manager Swift5 Platform GitHub repo size

Simple ratio based image cropper for SwiftUI

Screen Shot 2020-12-18 at 5 05 30 PM

Requirements

  • Xcode 12
  • Swift 5.3

Integration

ImageCropper is available via Swift Package Manager

Using Xcode 12, go to File -> Swift Packages -> Add Package Dependency and enter https://github.com/marshallino16/ImageCropper

Usage

ImageCropper gives you access to a new view called ImageCropperView. It can be integrated within your view body like this :

let ratio = CropperRatio(width: 1, height: 1)

ImageCropperView(image: Image("stock"),
                 cropRect: nil,
                 ratio: ratio)
.onCropChanged { (newCrop) in
  print(newCrop)
}

Details

Parameters

Param Type Initial Value Optional
image Image no
cropRect CGRect nil yes
ratio CropperRatio no

Modifiers

ImageCropperView comes with one modifier

onCropChanged { ... }

Next

  • Pinch to zoom

License

ImageCropper is available under the MIT license. See the LICENSE file for more info.

Open Source Agenda is not affiliated with "Marshallino16 ImageCropper" Project. README Source: marshallino16/ImageCropper
Stars
47
Open Issues
2
Last Commit
2 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating