iOS中通过AssetsLibrary来支持多图选择
AssetsLibrary框架提供了ALAssetsLibrary类来帮助我们访问相册程序管理下的照片和视频,官方文档见此。
#pragma mark - - (void)getImages{ if (!self.assetsArray) { _assetsArray = [[NSMutableArray alloc] init]; } if (!self.assetsLibrary) { _assetsLibrary = [[ALAssetsLibrary alloc] init]; } @autoreleasepool { [self.assetsGroup enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) { if (result) { TTAsset *ttAsset = [[TTAsset alloc] initWithAsset:result]; [self.assetsArray addObject:ttAsset]; [ttAsset release], ttAsset = nil; } }]; } [self.tableView reloadData];}