AnyImageKit
is a toolbox for picking and editing photos. It's written in Swift.
- 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
- Photo
- Video
- Live Photo
- GIF
- Fliter
- Edit image ( Technical Preview )
- Drawing
- Emoji
- Input text
- Cropping
- Mosaic
- Rotate
- Fliter
- Multiple platform support
- iOS
- iPadOS
- Mac Catalyst ( Technical Preview, Not support in editor. Remove from support as Xcode 12.0 can't support Mac Catalyst 14.0 features. )
- macOS
- tvOS
- iOS 10.0+
- Xcode 12.0+
- Swift 5.3+
dependencies: [
.package(url: "https://github.com/AnyImageProject/AnyImageKit.git", .upToNextMajor(from: "0.9.0"))
]
Add this to Podfile
, and then update dependency:
pod 'AnyImageKit'
Add this to Cartfile
, and then update dependency:
github "AnyImageProject/AnyImageKit"
Add these keys to your Info.plist when needed:
Key | Module | Info |
---|---|---|
NSPhotoLibraryUsageDescription | Picker | |
NSPhotoLibraryAddUsageDescription | Picker | |
PHPhotoLibraryPreventAutomaticLimitedAccessAlert | Picker | Set YES to prevent automatic limited access alert in iOS 14+ (Picker has been adapted with Limited features that can be triggered by the user to enhance the user experience) |
NSCameraUsageDescription | Capture | |
NSMicrophoneUsageDescription | Capture |
import AnyImageKit
class ViewController: UIViewController {
@IBAction private func openPicker() {
let options = PickerOptionsInfo()
let controller = ImagePickerController(options: options, delegate: self)
present(controller, animated: true, completion: nil)
}
}
extension ViewController: ImagePickerControllerDelegate {
func imagePickerDidCancel(_ picker: ImagePickerController) {
// Your code, handle cancel
picker.dismiss(animated: true, completion: nil)
}
func imagePicker(_ picker: ImagePickerController, didFinishPicking result: PickerResult) {
// Your code, handle select assets
let images = result.assets.map { $0.image }
picker.dismiss(animated: true, completion: nil)
}
}
AnyImageKit is released under the MIT license. See LICENSE for details.