/AnyImageKit

A toolbox for picking and editing photo/video. Written in Swift.

Primary LanguageSwiftMIT LicenseMIT

AnyImageKit

GitHub Actions CocoaPods Compatible Carthage Compatible Platform License

AnyImageKit is a toolbox for picking and editing photos. It's written in Swift.

中文说明

Features

  • Light mode, dark mode or auto mode support
  • Default theme is similar with Wechat
  • Multiple & mix select support
  • Supported media types:
    • Photo
    • GIF
    • Live Photo
    • Video
  • Camera
  • Edit image ( Technical Preview )
    • Drawing
    • Emoji
    • Input text
    • Cropping
    • Mosaic
  • Multiple platform support
    • iOS
    • iPadOS ( Not support in editor )
    • Mac Catalyst ( Technical Preview, Not support in editor )
    • macOS
    • tvOS

Requirements

  • iOS 10.0+
  • Xcode 11.0+
  • Swift 5.0+

Installation

Add this to Podfile, and then update dependency:

pod 'AnyImageKit'

Add this to Cartfile, and then update dependency:

github "AnyImageProject/AnyImageKit"

Unsupport --no-use-binaries

Usage

Quick Start

import AnyImageKit

let controller = ImagePickerController(delegate: self)
present(controller, animated: true, completion: nil)

/// ImagePickerControllerDelegate
func imagePickerDidCancel(_ picker: ImagePickerController) {
    // Your code, handle cancel
    picker.dismiss(animated: true, completion: nil)
}
    
func imagePicker(_ picker: ImagePickerController, didFinishPicking assets: [Asset], useOriginalImage: Bool) {
    // Your code, handle select assets
    let images = assets.map { $0.image }
    picker.dismiss(animated: true, completion: nil)
}

Fetch content data

/// Fetch Video URL 
/// - Note: Only for `MediaType` Video
/// - Parameter options: Video URL Fetch Options
/// - Parameter completion: Video URL Fetch Completion
func fetchVideoURL(options: VideoURLFetchOptions = .init(), completion: @escaping VideoURLFetchCompletion)

// Call
asset.fetchVideoURL { (result) in
    // Your code
}

Quick Look

License

AnyImageKit is released under the MIT license. See LICENSE for details.