LKAssetsLibraryALAsets图书馆实用程序
LKAssetsLibrary 提供 ALAssetsLibrary 分组/过滤/排序 功能。
用法:
LKAssetsLibrary具有3个基本类:
LKAssetsLibrary
LKAassetsGroup
LKasset
这些是ALAssetsLibrary,ALAssetsGroup,ALAsset的包装类。它们具有便捷的方法(例如LKAsset.thumbnail,LKAsset.date等)。
LKAssetsLibrary在获取资产后发布通知。您可以通过观察通知来处理资产。
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_assetsLibraryDidSetup:)
name:LKAssetsLibraryDidSetupNotification
object:nil];
self.assetsLibrary = [LKAssetsLibrary assetsLibrary];
[self.assetsLibrary reload];
}
收到通知后,请使用LKAssetGroup或LKAsset。
- (void)_assetsLibraryDidSetup:(NSNotification*)notification
{
[self.tableView reloadData];
}
对UITableViewCell使用LKAssetsGroup。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GroupCell" forIndexPath:indexPath];
LKAssetsGroup* assetsGroup = self.assetsLibrary.assetsGroups[indexPath.row];
cell.imageView.image = assetsGroup.posterImage;
cell.textLabel.text = assetsGroup.description;
return cell;
}
用于UICollectionViewCell。
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
AssetCell* cell = (AssetCell*)[collectionView dequeueReusableCellWithReuseIdentifier:@"AssetCell"
forIndexPath:indexPath];
LKAsset* asset = [self.assetsCollection assetForIndexPath:indexPath];
cell.imageView.image = asset.thumbnail;
return cell;
}
评论
SelectivizrJavaScript实用程序
Selectivizr 是 JavaScript 实用程序,模拟 IE 6-8 的 CSS3 伪类和
SelectivizrJavaScript实用程序
0
SelectivizrJavaScript实用程序
Selectivizr是JavaScript实用程序,模拟IE6-8的CSS3伪类和属性选择器,可以在IE无缝使用CSS3选择器。selectivizr可在InternetExplorer6-8中模拟
SelectivizrJavaScript实用程序
0
jboss-test-auditTCK实用程序类
jboss-test-audit用于TCK测试覆盖报告的实用程序类。(UtilityclassesforTCKTestCoverageReport.)
jboss-test-auditTCK实用程序类
0
google-apputilsPython 绑定实用程序集
Google Application Utilities for Python 是绑定 Python
google-apputilsPython 绑定实用程序集
0
Nightfall for MacmacOS 菜单栏实用程序
Nightfall是一款用于快速切换macOS明/暗模式的菜单栏实用程序。安装Nightfall需要macOSCatalina或更高版本注意:该构建没有签名,因此需要用户绕过Gatekeeper才能运
Nightfall for MacmacOS 菜单栏实用程序
0
Nightfall for MacmacOS 菜单栏实用程序
Nightfall 是一款用于快速切换 macOS 明/暗模式的菜单栏实用程序。安装Nightfal
Nightfall for MacmacOS 菜单栏实用程序
0