Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 是否可以使用UIImagePickerController在用户创建的相册中选择照片和视频_Swift_Uiimagepickercontroller_Photo_Alassetslibrary - Fatal编程技术网

Swift 是否可以使用UIImagePickerController在用户创建的相册中选择照片和视频

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

我已经使用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 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