DKImagePickerController
=======================
[![Build Status](https://secure.travis-ci.org/zhangao0086/DKImagePickerController.svg)](http://travis-ci.org/zhangao0086/DKImagePickerController) [![Version Status](http://img.shields.io/cocoapods/v/DKImagePickerController.png)][docsLink] [![license MIT](https://img.shields.io/cocoapods/l/DKImagePickerController.svg?style=flat)][mitLink] [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
<img width="50%" height="50%" src="https://raw.githubusercontent.com/zhangao0086/DKImagePickerController/develop/Screenshot3.png" /><img width="50%" height="50%" src="https://raw.githubusercontent.com/zhangao0086/DKImagePickerController/develop/Screenshot4.png" />
---
<img width="50%" height="50%" src="https://raw.githubusercontent.com/zhangao0086/DKImagePickerController/develop/Screenshot11.png" /><img width="50%" height="50%" src="https://raw.githubusercontent.com/zhangao0086/DKImagePickerController/develop/Screenshot6.png" />
---
## Description
`DKImagePickerController` is a highly customizable, pure-Swift library.
### Features
* Supports both single and multiple selection.
* Supports filtering albums and sorting by type.
* Supports landscape, iPad, and orientation switching.
* Supports iCloud.
* Supports batch exports `PHAsset` to files.
* Inline mode.
* Customizable `UICollectionViewLayout`.
* Customizable `camera`, `photo gallery` and `photo editor`.
## Requirements
* iOS 8.0+
* ARC
* Swift 3.2 & 4.2
## Installation
### CocoaPods
#### iOS 8 and newer
DKImagePickerController is available on CocoaPods. Simply add the following line to your podfile:
```
# For latest release in cocoapods
pod 'DKImagePickerController'
```
#### For Swift 4.1
```
pod 'DKImagePickerController', :git => 'https://github.com/zhangao0086/DKImagePickerController.git', :branch => 'Swift4'
```
#### Subspecs
There are 7 subspecs available now:
| Subspec | Description |
|---|---|
| Core | Required. |
| ImageDataManager | Required. The subspec provides data to `DKImagePickerController`. |
| Resource | Required. The subspec provides resource management and internationalization. |
| PhotoGallery | Optional. The subspec provides preview feature for PHAsset. |
| Camera | Optional. The subspec provides camera feature. |
| InlineCamera | Optional. The subspec should be pushed by `UINavigationController`, like `UIImagePickerController` with `UIImagePickerControllerSourceType.camera`. |
| PhotoEditor | Optional. The subspec provides basic image editing features. |
This means you can install only some of the `DKImagePickerController` modules. By default, you get all subspecs.
If you need to use your own photo editor, simply specify subspecs other than `PhotoEditor`:
```ruby
pod 'DKImagePickerController', :subspecs => ['PhotoGallery', 'Camera', 'InlineCamera']
```
More information, see [Extensions](#extensions).
### Carthage
```
github "zhangao0086/DKImagePickerController"
```
If you use Carthage to build your dependencies, make sure you have added `CropViewController.framework`, `DKCamera.framework`, `DKImagePickerController.framework`, `DKPhotoGallery.framework` and `SDWebImage.framework` to the _"Linked Frameworks and Libraries"_ section of your target, and have included them in your Carthage framework copying build phase.
## Getting Started
#### Initialization and presentation
```swift
let pickerController = DKImagePickerController()
pickerController.didSelectAssets = { (assets: [DKAsset]) in
print("didSelectAssets")
print(assets)
}
self.presentViewController(pickerController, animated: true) {}
````
#### Configurations
```swift
/// Use UIDelegate to Customize the picker UI.
@objc public var UIDelegate: DKImagePickerControllerBaseUIDelegate!
/// Forces deselect of previous selected image. allowSwipeToSelect will be ignored.
@objc public var singleSelect = false
/// Auto close picker on single select
@objc public var autoCloseOnSingleSelect = true
/// The maximum count of assets which the user will be able to select, a value of 0 means no limit.
@objc public var maxSelectableCount = 0
/// Photos will be tagged with the location where they are taken.
/// If true, your Info.plist should include the "Privacy - Location XXX" tag.
open var containsGPSInMetadata = false
/// Set the defaultAssetGroup to specify which album is the default asset group.
public var defaultAssetGroup: PHAssetCollectionSubtype?
/// Allow swipe to select images.
@objc public var allowSwipeToSelect: Bool = false
/// Allow select all
@objc public var allowSelectAll: Bool = false
/// A Bool value indicating whether the inline mode is enabled.
@objc public var inline: Bool = false
/// The type of picker interface to be displayed by the controller.
@objc public var assetType: DKImagePickerControllerAssetType = .allAssets
/// If sourceType is Camera will cause the assetType & maxSelectableCount & allowMultipleTypes & defaultSelectedAssets to be ignored.
@objc public var sourceType: DKImagePickerControllerSourceType = .both
/// A Bool value indicating whether allows to select photos and videos at the same time.
@objc public var allowMultipleTypes = true
/// A Bool value indicating whether to allow the picker auto-rotate the screen.
@objc public var allowsLandscape = false
/// Set the showsEmptyAlbums to specify whether or not the empty albums is shown in the picker.
@objc public var showsEmptyAlbums = true
/// A Bool value indicating whether to allow the picker shows the cancel button.
@objc public var showsCancelButton = false
/// The block is executed when the user presses the cancel button.
@objc public var didCancel: (() -> Void)?
/// The block is executed when the user presses the select button.
@objc public var didSelectAssets: ((_ assets: [DKAsset]) -> Void)?
/// The block is executed when the number of selected assets is changed.
@objc public var selectedChanged: (() -> Void)?
/// A Bool value indicating whether to allow the picker to auto-export the selected assets to the specified directory when done is called.
/// picker will creating a default exporter if exportsWhenCompleted is true and the exporter is nil.
@objc public var exportsWhenCompleted = false
@objc public var exporter: DKImageAssetExporter?
/// Indicates the status of the exporter.
@objc public private(set) var exportStatus = DKImagePickerControllerExportStatus.none {
willSet {
if self.exportStatus != newValue {
self.willChangeValue(forKey: #keyPath(DKImagePickerController.exportStatus))
}
}
didSet {
if self.exportStatus != oldValue {
self.didChangeValue(forKey: #keyPath(DKImagePickerController.exportStatus))
self.exportStatusChanged?(self.exportStatus)
}
}
}
/// The block is executed when the exportStatus is changed.
@objc public var exportStatusChanged: ((DKImagePickerControllerExportStatus) -> Void)?
/// The object that acts as the data source of the picker.
@objc public private(set) lazy var groupDataManager: DKImageGroupDataManager
```
## Inline Mode
<img width="30%" height="30%" src="https://raw.githubusercontent.com/zhangao0086/DKImagePickerController/develop/Screenshot11.png" />
```swift
let groupDataManagerConfiguration = DKImageGroupDataManagerConfiguration()
groupDataManagerConfiguration.fetchLimit = 10
groupDataManagerConfiguration.assetGroupTypes = [.smartAlbumUserLibrary]
let groupDataManager = DKImageGroupDataManager(configuration: groupDataManagerConfiguration)
self.pickerController = DKImagePickerController(groupDataManager: groupDataManager)
pickerController.inline = true
pickerController.UIDelegate = CustomInlineLayoutUIDelegate(imagePickerController: pickerController)
pickerController.assetType = .allPhotos
pickerController.sourceType = .photo
let pickerView = self.pickerController.v
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
iOS开发教程案例代码.zip (2000个子文件)
contents 784B
contents 757B
Gemfile 74B
.gitignore 295B
.gitignore 37B
.gitignore 6B
AMapSearchObj.h 33KB
AMapCommonObj.h 27KB
MAMapView.h 22KB
TOCropViewController.h 18KB
MAGeometry.h 14KB
AMapSearchAPI.h 13KB
AMapLocationManager.h 10KB
TOCropView.h 9KB
AMapGeoFenceManager.h 9KB
fts3_tokenizer.h 6KB
AMapLocationCommonObj.h 6KB
FXPageControl.h 4KB
TOCropToolbar.h 4KB
AMapSearchError.h 4KB
MAAnnotationView.h 3KB
AMapGeoFenceRegionObj.h 3KB
TOCropViewConstants.h 3KB
AMapLocationRegionObj.h 3KB
MAOverlayRenderer.h 3KB
MAOverlayView.h 2KB
MATileOverlay.h 2KB
TOCropViewControllerTransitioning.h 2KB
MAOverlayPathView.h 2KB
MAOverlayPathRenderer.h 2KB
MAPolygon.h 2KB
AMapNearbySearchManager.h 2KB
NSObject+AMapJsonSerialization.h 2KB
MAMultiPolyline.h 2KB
TOCropOverlayView.h 2KB
AMapURLSearchConfig.h 2KB
TOActivityCroppedImageProvider.h 2KB
TOCropScrollView.h 2KB
TOCroppedImageAttributes.h 2KB
Kingfisher.h 2KB
Kingfisher.h 2KB
Kingfisher.h 2KB
Kingfisher.h 2KB
Kingfisher.h 2KB
Kingfisher.h 2KB
Kingfisher.h 2KB
AMapUtility.h 2KB
SQLiteObjc.h 1KB
CropViewController.h 1KB
MAMapKit.h 1KB
AMapURLSearchType.h 1KB
MAGroundOverlay.h 1KB
MAHeatMapTileOverlay.h 1KB
UIImage+CropRotate.h 1KB
AMapServices.h 1KB
MAMultiColoredPolylineRenderer.h 1KB
MACircle.h 1KB
MAPolyline.h 1KB
AMapURLSearch.h 1012B
MAUserLocationRepresentation.h 973B
AMapNearbyUploadInfo.h 920B
MAMultiPoint.h 863B
MAUserLocation.h 854B
MAGeodesicPolyline.h 843B
AMapGeoFenceError.h 825B
MAAnnotation.h 802B
AMapLocationVersion.h 793B
AMapSearchVersion.h 776B
MAOverlay.h 759B
MAGroundOverlayRenderer.h 759B
MATileOverlayRenderer.h 756B
MAGroundOverlayView.h 745B
MATileOverlayView.h 734B
MAPinAnnotationView.h 731B
MAMapVersion.h 690B
CropViewController-umbrella.h 689B
MAPolygonRenderer.h 644B
MAPolylineRenderer.h 642B
MAPolygonView.h 635B
MAPolylineView.h 633B
MACircleRenderer.h 618B
AMapFoundationKit.h 603B
MACircleView.h 584B
MAPointAnnotation.h 556B
FSPagerViewObjcCompat.h 521B
MAShape.h 496B
AMapLocationKit.h 483B
AMapFoundationVersion.h 447B
AMapSearchKit.h 445B
Pods-ThirdFrameworkUsageUITests-umbrella.h 354B
Pods-ThirdFrameworkUsageTests-umbrella.h 350B
FSPagerView-umbrella.h 348B
XLPagerTabStrip-umbrella.h 348B
Pods-AFN上传文件-AFN上传文件UITests-umbrella.h 346B
Pods-AFN上传文件-AFN上传文件UITests-umbrella.h 346B
Pods-Alamofire的基本使用UITests-umbrella.h 344B
NSMutableDictionary+AMapSafe.h 344B
Pods-Alamofire的基本使用Tests-umbrella.h 340B
Pods-ThirdFrameworkUsage-umbrella.h 340B
Pods-一个完整的网络请求案例UITests-umbrella.h 338B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
博士僧小星
- 粉丝: 1746
- 资源: 5850
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功