Giter VIP home page Giter VIP logo

adphotokit's Introduction

logo

Version License Platform Language

ADPhotoKit is a pure-Swift library to select assets (e.g. photo,video,gif,livephoto) from system album. Default appearance is Wechat-like.

Features

  • Well documentation.
  • Supports both single and multiple selection.
  • Supports filtering albums and sorting by type.
  • iCloud Support.
  • Multi-language.
  • Highly customizable base on protocol(UI/Image/Color/Font).
  • UIAppearance support.
  • Supports batch export PHAsset to image.
  • Image editor.
  • DocC support.
  • Custom camera.
  • Video editor.

Usage

Quick Start

The simplest use-case is present the image picker on your controller:

ADPhotoKitUI.imagePicker(present: self) { (assets, origin) in
    // do something
}

More Advanced Example

Select up to 9 images or videos:

ADPhotoKitUI.imagePicker(present: self,
                          params: [.maxCount(max: 9)],
                        selected: { (assets, origin) in
    // do something
})

Select 1 video or 9 images:

ADPhotoKitUI.imagePicker(present: self,
                       assetOpts: .exclusive,
                          params: [.maxCount(max: 9),.imageCount(min: nil, max: 9),.videoCount(min: nil, max: 1)],
                        selected: { (assets, origin) in
    // do something
})

Select max 8 images:

ADPhotoKitUI.imagePicker(present: self,
                       albumOpts: [.allowImage],
                       assetOpts: .exclusive,
                          params: [.maxCount(max: 8)],
                        selected: { (assets, origin) in
    // do something
})

Browser network image and video:

ADPhotoKitUI.assetBrowser(present: self, 
                           assets: [NetImage(url: "https://example.com/xx.png"), NetVideo(url: "https://example.com/xx.mp4")]) { assets in
    // do something
}

For more usage configuration, you can see ADPhotoKitUI.

Learn More

To lean more use of ADPhotoKit, refer to the example and API Reference.

Requirements

  • iOS 10.0
  • Swift 5.0+

Objective-C is not supported. Swift is the future and dropping Obj-C is the price to pay to keep our velocity on this library :)

Installation

CocoaPods

ADPhotoKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

source 'https://cdn.cocoapods.org/'
platform :ios, '10.0'
use_frameworks!

target 'MyApp' do
  pod 'ADPhotoKit'
end

DocC support need cocoaPods 1.12.0+

Subspecs

There are 4 subspecs available now:

Subspec Description
Base Required. This subspec provides base configuration and extensions.
Core Optional. This subspec provides raw data.
CoreUI Optional. The subspec provides ui for photo select.
ImageEdit Optional. The subspec provides image edit ability.

You can install only some of the ADPhotoKit modules. By default, you get CoreUI subspecs.

Swift Package Manager

Note

You need to add the following key-value pairs in your app's Info.plist

// If you don’t add this key-value pair, multiple languages are not supported, and the system PhotoKitUI language defaults to English
Localized resources can be mixed   YES
// You must add follow in your app's Info.plist
Privacy - Photo Library Usage Description
// If you `assetOpts` contain `allowTakePhotoAsset`, you must add follow
Privacy - Camera Usage Description
// If you `assetOpts` contain `allowTakeVideoAsset`, you must add follow
Privacy - Microphone Usage Description

Contributing

If you have feature requests or bug reports, feel free to help out by sending pull requests or by creating new issues.

License

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

Some code and resource are copy from ZLPhotoBrowser

adphotokit's People

Contributors

duzexu 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.