unityios相册_ios创建相册

- (IBAction)tt:(id)sender {

NSLog(@"%@",@"FF");

[self insertImage: NULL intoAlbumNamed:@"bbbbsssss"];

}

- (void)insertImage:(UIImage *)image intoAlbumNamed:(NSString *)albumName {

//Fetch a collection in the photos library that has the title "albumNmame"

PHAssetCollection *collection = [self fetchAssetCollectionWithAlbumName: albumName];

if (collection == nil) {

//If we were unable to find a collection named "albumName" we'll create it before inserting the image

[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{

[PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle: albumName];

} completionHandler:^(BOOL success, NSError * _Nullable error) {

if (error != nil) {

NSLog(@"Error inserting image into album: %@", error.localizedDescription);

}

if (success) {

//Fetch the newly created collection (which we *assume* exists here)

PHAssetCollection *newCollection = [self fetchAssetCollectionWithAlbumName:albumName];

// [self insertImage:image intoAssetCollection: newCollection];

}

}];

} else {

//If we found the existing AssetCollection with the title "albumName", insert into it

// [self insertImage:image intoAssetCollection: collection];

}

}

- (PHAssetCollection *)fetchAssetCollectionWithAlbumName:(NSString *)albumName {

PHFetchOptions *fetchOptions = [PHFetchOptions new];

//Provide the predicate to match the title of the album.

fetchOptions.predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"title == '%@'", albumName]];

//Fetch the album using the fetch option

PHFetchResult *fetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:fetchOptions];

//Assuming the album exists and no album shares it's name, it should be the only result fetched

return fetchResult.firstObject;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1024app_ios_2.3.4是一款专为iOS设备设计的应用程序,其版本号为2.3.4。该应用程序在功能上提供了丰富的内容和服务,可以满足用户在不同方面的需求。 1024app_ios_2.3.4首先具备了强大的应用市场功能,用户可以通过该应用程序方便地浏览和搜索各种类型的应用,包括游戏、社交媒体、工具类等。用户可以根据自己的兴趣和需求下载和安装这些应用,并在手机上进行使用。 其次,1024app_ios_2.3.4还提供了个性化推荐功能,根据用户的使用习惯和喜好,推荐适合用户的应用程序。这样,用户可以更加高效地发现和使用他们感兴趣的应用,提高了用户体验。 另外,1024app_ios_2.3.4还支持应用的更新和升级。用户可以在应用程序中获得关于已安装应用的最新版本信息,并进行更新。这样,用户可以及时获得应用程序的最新功能和修复bug,提高了应用的稳定性和安全性。 最后,1024app_ios_2.3.4还具备了一些额外的功能,例如用户可以在应用中进行应用评分和评论,与其他用户交流和分享使用心得。此外,用户还可以通过该应用程序获取关于应用的详细信息,如应用的大小、开发者介绍等。 综上所述,1024app_ios_2.3.4是一款功能强大的iOS应用程序,用户可以在其中浏览和下载各种类型的应用,享受个性化推荐、应用更新和升级等服务。同时,用户还可以与其他用户互动交流,获取应用的详细信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值