Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

abu0306/CnPhoto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

52 Commits

Repository files navigation

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()
 }

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

About

CnPhoto

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /