Photos(PHAssetCreationRequest)
Photos(PHAssetCollectionChangeRequest)
Photos(PHCollectionListChangeRequest)
PHAssetCollectionChangeRequest可创建、删除和修改PHAssetCollection对象。
1 Adding New Asset Collections
/// 创建相册
///
/// - parameter title : 相册名
///
/// - returns: PHAssetCollectionChangeRequest
public class func creationRequestForAssetCollectionWithTitle(title: String) -> Self
/// 新创建的相册
public var placeholderForCreatedAssetCollection: PHObjectPlaceholder { get }
2 Deleting Asset Collections
/// 删除指定的PHAssetCollection
///
/// - parameter assetCollections : [PHAssetCollection]
///
/// - returns: void
public class func deleteAssetCollections(assetCollections: NSFastEnumeration)
3 Modifying Asset Collections
/// 通过PHAssetCollection初始化PHAssetCollectionChangeRequest
public convenience init?(forAssetCollection assetCollection: PHAssetCollection)
/// 初始化使用PHFetchResult替换PHAssetCollection内部数据
public convenience init?(forAssetCollection assetCollection: PHAssetCollection, assets: PHFetchResult)
/// 相册名
public var title: String
/// 增加[PHAsset]
public func addAssets(assets: NSFastEnumeration)
/// 插入[PHAsset]
public func insertAssets(assets: NSFastEnumeration, atIndexes indexes: NSIndexSet)
/// 删除[PHAsset]
public func removeAssets(assets: NSFastEnumeration)
/// 删除指定位置的[PHAsset]
public func removeAssetsAtIndexes(indexes: NSIndexSet)
/// 替换指定位置的[PHAsset]
public func replaceAssetsAtIndexes(indexes: NSIndexSet, withAssets assets: NSFastEnumeration)
/// 移动[PHAsset]到指定的位置
public func moveAssetsAtIndexes(fromIndexes: NSIndexSet, toIndex: Int)
其他
源代码
参考资料
PHAssetCreationRequest Class Reference
文档修改记录
时间 | 描述 |
---|---|
2016-01-07 | 博文完成 |