GithubHelp home page GithubHelp logo

liweican1992 / anyimagekit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anyimagekit/anyimagekit

0.0 1.0 0.0 5.77 MB

A toolbox for pick/edit/capture photo or video. Written in Swift.

License: MIT License

Objective-C 0.07% Swift 99.27% Ruby 0.24% Shell 0.27% Metal 0.15%

anyimagekit's Introduction

AnyImageKit

GitHub Actions CocoaPods Compatible Carthage Compatible Platform License

AnyImageKit is a toolbox for picking, editing or capturing photos/videos, written in Swift.

中文说明

Features

  • Modular design
    • Picker
    • Browser
    • Editor
    • Capture
  • 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 Support
  • Edit image ( Technical Preview )
    • Drawing
    • Emoji
    • Input text
    • Cropping
    • Mosaic
    • Rotate
    • Fliter Support
  • Multiple platform support
    • iOS
    • iPadOS
    • Mac Catalyst ( Technical Preview, Not support in editor.)
    • macOS
    • tvOS

Requirements

  • iOS 10.0+
  • Xcode 12.2+
  • Swift 5.3+

Installation

⚠️ Needs Xcode 12.0+ to support resources and localization files

dependencies: [
    .package(url: "https://github.com/AnyImageProject/AnyImageKit.git", .upToNextMajor(from: "0.12.0"))
]

Add this to Podfile, and then update dependency:

pod 'AnyImageKit'

Add this to Cartfile, and then update dependency:

github "AnyImageProject/AnyImageKit"

⚠️ Unsupport in Xcode 12.0, more details

Usage

Prepare

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

Quick Start

import AnyImageKit

class ViewController: UIViewController {

    @IBAction private func openPicker(_ sender: UIButton) {
        var options = PickerOptionsInfo()
        /*
          Your code, handle custom options
        */
        let controller = ImagePickerController(options: options, delegate: self)
        present(controller, animated: true, completion: nil)
    }
}

extension ViewController: ImagePickerControllerDelegate {

    func imagePickerDidCancel(_ picker: ImagePickerController) {
        /*
          Your code, handle user cancel
        */
        picker.dismiss(animated: true, completion: nil)
    }
    
    func imagePicker(_ picker: ImagePickerController, didFinishPicking result: PickerResult) {
        let images = result.assets.map { $0.image }
        /*
          Your code, handle selected assets
        */
        picker.dismiss(animated: true, completion: nil)
    }
}

Release Notes

Version Release Date Xcode Swift iOS
v0.12.0 2020-12-30 12.2 5.3 10.0+
v0.11.0 2020-12-18 12.2 5.3 10.0+
v0.10.0 2020-11-03 12.1 5.3 10.0+
v0.9.0 2020-10-09 12.0 5.3 10.0+

License

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

anyimagekit's People

Contributors

anotheren avatar rayjiang16 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.