Giter VIP home page Giter VIP logo

cnphoto's Introduction

CnPhoto


CnPhoto 基于系统Photo框架开发,适用于iOS8.0以后版本

Installation

CnPhoto supports multiple methods for installing the library in a project. Installation with CocoaPods

Podfile 1,To integrate CnPhoto into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'
use_frameworks!

target 'TargetName' do
pod 'CnPhoto'
end

Then, run the following command:

$ pod install

2,Direct download package, to join the project, don't need any dependent libraries


Usage The default navigation album: 单选相册:

/// 单选相册默认导航
//self.photoAlbum(false)

//单选相册自定义导航
self.photoAlbum(false, .lightContent, UIColor.black, tintColor: UIColor.white, bgColor: UIColor.white)

多选相册:

/// 多选相册默认导航
//self.photoAlbum(true)

//多选相册自定义导航
self.photoAlbum(true, .lightContent, UIColor.black, tintColor: UIColor.white, bgColor: UIColor.white)

相册回调:

//    /// UIImage异步回调
//    ///
//    /// - Parameter img: _
//    func completeSinglePicture(_ img: UIImage) {
//        myImageView.image = img
//    }

    /// UIImage同步回调
    ///
    /// - Parameters:
    ///   - img: _
    ///   - completeHandle: 回调控制
    func completeSinglePicture(_ img: UIImage, _ completeHandle: () -> ()) {
        myImageView.image = img
        completeHandle()
    }

    /// [UIImage]多选相册自定义导航异步回调
    ///
    /// - Parameter imgArray: _
//    func completeDoublePicture(_ imgArray: [UIImage]) {
//        myImageView.image = imgArray[0]
//        print(imgArray)
//    }

    /// [UIImage]多选相册自定义导航同步回调
    ///
    func completeSynchronousDoublePicture(_ imgArray: [UIImage], _ completeHandle: () -> ()) {

        myImageView.image = imgArray[0]
        print(imgArray)
        completeHandle()
    }

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍

cnphoto's People

Contributors

abu0306 avatar tomk12 avatar

Stargazers

 avatar 沈鹏 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  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.