您的位置:首页 > 其它

PHCollectionList+Extension

2015-12-26 20:12 323 查看
//
//  PHCollectionList+Extension.swift
//  Photo
//
//  CSDN:http://blog.csdn.net/y550918116j
//  GitHub:https://github.com/937447974/Blog
//
//  Created by yangjun on 15/12/26.
//  Copyright © 2015年 阳君. All rights reserved.
//

import UIKit
import Photos

public extension PHCollectionList {

/// 获取PHAsset集合
///
/// - parameter options : PHFetchOptions?
///
/// - returns: [PHAsset]
func fetchAssetsWithOptions(options: PHFetchOptions?) -> [PHAsset] {
var assets = [PHAsset]()
let fetchResult = PHAssetCollection.fetchMomentsInMomentList(self, options: options)
fetchResult.enumerateObjectsUsingBlock { (obj: AnyObject, index: Int, umPointer: UnsafeMutablePointer<ObjCBool>) -> Void in
if let assetCollection = obj as? PHAssetCollection {
assets.appendContentsOf(assetCollection.fetchAssetsWithOptions(options))
}
}
return assets
}

}


其他

源代码

Swift

文档修改记录

时间描述
2015-12-26博文完成

版权所有

CSDN:http://blog.csdn.net/y550918116j

GitHub:https://github.com/937447974/Blog
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: