15

500px技术周报008

 3 years ago
source link: http://quangelab.com/500px-work-note-008/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
500px技术周报008 – ruquan.z – github技术博客,成长在于积累。

500px技术周报008

目前APP的相册界面有两个问题:1、airdrop传过来的照片没有在最前面 2、照片在上万张的情况下容易闪退。

代码中使用creationDate排序,如果不使用creationDate排序则是倒序,最早的在前面

self.fetchOptions = [PHFetchOptions new];
self.fetchOptions.predicate = [NSPredicate predicateWithFormat:@"mediaType = %i", PHAssetMediaTypeImage];
self.fetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]];

去掉代码中使用creationDate排序

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
	PHAsset *asset = self.assetFetchResults[self.assetFetchResults.count-indexPath.item];
}

那么在微信和QQ是如何来实现的?请看下图

qq
wechat

可以看到都是使用uitableview,每个cell里有四个等比例图,默认进入到列表的最下面。

qq

微博和图虫

weibo
wechat

两者都使用的是uicollectionview,默认进入列表的最上端

Written on November 17, 2017

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK