Save video in a specific folder

I am saving video in my photo album using this code:

    ALAssetsLibrary *assetLibrary = [[ALAssetsLibrary alloc] init];
    [assetLibrary writeVideoAtPathToSavedPhotosAlbum:[NSURL URLWithString:videoPath] completionBlock:^(NSURL *assetURL, NSError *error)
    {
         NSError *removeError = nil;
         [[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:videoPath] error:&removeError];
    });

      

The video goes to the Videos folder , but I want it to move to a specific folder with the application name. How can i do this?

+3


source to share


1 answer


like this



 ALAssetsLibrary* assetLibrary = [[ALAssetsLibrary alloc] init];
 [assetLibrary writeVideoAtPathToSavedPhotosAlbum:[NSURL URLWithString:@""] completionBlock:^(NSURL *assetURL, NSError *error) {
    [assetLibrary addAssetURL:[NSURL URLWithString:@""]  toAlbum:@"" completion:^(NSURL *assetURL, NSError *error) {
    NSError* removeError = nil;
        [[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:@""] error:&removeError];
    } failure:^(NSError *error) {
        NSLog(@"%@", error);
    }];
}];

      

0


source







All Articles