This package allows you to:
- Import Images and Videos
- Edit Images and Videos
Swift Package Manager
You can use the individial files depending on your needs. For a holistic unified approach use:
Allows for cropping, rotating images and more features coming. It also allows for dragging and dropping any image from Photos, Finder, Safari, anywhere you can drag an image from.
Feel free to add your implementations and submit a pr.
/// a holistic image picker that allows for picking or dropping image to the attached view and editing the image before retuning the final image.
/// the image editor uses gestures, keep this in mind when attaching this modifier to a sheet, a scrollview or any view with gestures enabled
/// - Parameters:
/// - isPresented: a bool that directly controls the media picker
/// - aspectRatio: desired aspect ratio, when the mash shape is curcular this value is ignored in favour of 1
/// - maskShape: desired mask shape, when you choose circular the aspect ratio is automatically 1
/// - isGuarded: a bool that indicates whether the attached view can accept dropping of images
/// - onCompletion: call back with a result of type `Result<UnifiedImage, Error>`
///
@inlinable public func imagePicker(
_ isPresented: Binding<Bool>,
aspectRatio: CGFloat,
maskShape: MaskShape = .rectangular,
isGuarded: Binding<Bool>,
onCompletion: @escaping (Result<UnifiedImage, Error>) -> Void
) -> some View
/// a holistic video picker that allows for picking or dropping of videos or url with videos to the attached view
/// and editing of the video before retuning the url in the local file sytem.
/// internet urls will be downloaded before editing the video.
/// - Parameters:
/// - isPresented: a bool that directly controls the media picker
/// - isGuarded: a bool that indicates whether the attached view can accept dropping of url or video
/// - onCompletion: call back with a result of type `Result<URL, Error>`, the url is a local file url
@inlinable public func videoPicker(
_ isPresented: Binding<Bool>,
isGuarded: Binding<Bool>,
onCompletion: @escaping (Result<URL, Error>) -> Void
) -> some View
What this allows you to do is enable drag and drop to the view,edit the asset then retun the edited asset.
The isPresented
directly controls the PhotosPicker in iOS and finder window in macOS.
- Adding Stickers on Image/Video
- Custom Audio to Video
- Drawing on Image/Video
- Drag and Drop Delegates
Some features may require higher versions. But generally it supports the following:
- iOS 13+
- macOS 10.15+
Although the package is written mainly for SwiftUI, image and video manipulations can be used in UIKit and AppKit.
Feel free to contribute via fork/pull request to main branch. If you want to request a feature or report a bug please start a new issue.
MIT