Swift 是否可以使用UIImagePickerController在用户创建的相册中选择照片和视频
我已经使用Photo框架以编程方式创建了一个相册Swift 是否可以使用UIImagePickerController在用户创建的相册中选择照片和视频,swift,uiimagepickercontroller,photo,alassetslibrary,Swift,Uiimagepickercontroller,Photo,Alassetslibrary,我已经使用Photo框架以编程方式创建了一个相册 if let first_Obj:AnyObject = collection.firstObject{ //found the album self.albumFound = true self.assetCollection = collection.firstObject as PHAssetCollection }else{ //Album placeholder for the asset collect
if let first_Obj:AnyObject = collection.firstObject{
//found the album
self.albumFound = true
self.assetCollection = collection.firstObject as PHAssetCollection
}else{
//Album placeholder for the asset collection, used to reference collection in completion handler
var albumPlaceholder:PHObjectPlaceholder!
//create the folder
NSLog("\nFolder \"%@\" does not exist\nCreating now...", albumName)
PHPhotoLibrary.sharedPhotoLibrary().performChanges({
let request = PHAssetCollectionChangeRequest.creationRequestForAssetCollectionWithTitle(albumName)
albumPlaceholder = request.placeholderForCreatedAssetCollection
},
completionHandler: {(success:Bool, error:NSError!)in
NSLog("Creation of folder -> %@", (success ? "Success":"Error!"))
self.albumFound = (success ? true:false)
if(success){
let collection = PHAssetCollection.fetchAssetCollectionsWithLocalIdentifiers([albumPlaceholder.localIdentifier], options: nil)
self.assetCollection = collection?.firstObject as PHAssetCollection
}
现在我对使用ImagePicker从相册中抓取视频感兴趣。。。这可能吗?还是我必须以其他方式实现这一点?我还希望视频(剪辑)是可编辑的,所以如果可能的话,我想使用UIImagePickerController