Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
dz_TZImagePickerController
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuijing
dz_TZImagePickerController
Commits
f2d090ba
Commit
f2d090ba
authored
Jun 08, 2016
by
banchichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化照片排序,改成按更新时间排序
parent
8aad3746
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+5
-2
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+1
-1
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
f2d090ba
...
...
@@ -67,7 +67,8 @@ static CGFloat TZScreenScale;
if
(
!
allowPickingVideo
)
option
.
predicate
=
[
NSPredicate
predicateWithFormat
:
@"mediaType == %ld"
,
PHAssetMediaTypeImage
];
if
(
!
allowPickingImage
)
option
.
predicate
=
[
NSPredicate
predicateWithFormat
:
@"mediaType == %ld"
,
PHAssetMediaTypeVideo
];
option
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"creationDate"
ascending
:
YES
]];
// option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:YES]];
option
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"modificationDate"
ascending
:
YES
]];
PHFetchResult
*
smartAlbums
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
nil
];
for
(
PHAssetCollection
*
collection
in
smartAlbums
)
{
...
...
@@ -98,7 +99,9 @@ static CGFloat TZScreenScale;
if
(
!
allowPickingVideo
)
option
.
predicate
=
[
NSPredicate
predicateWithFormat
:
@"mediaType == %ld"
,
PHAssetMediaTypeImage
];
if
(
!
allowPickingImage
)
option
.
predicate
=
[
NSPredicate
predicateWithFormat
:
@"mediaType == %ld"
,
PHAssetMediaTypeVideo
];
option
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"creationDate"
ascending
:
YES
]];
// option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:YES]];
option
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"modificationDate"
ascending
:
YES
]];
PHAssetCollectionSubtype
smartAlbumSubtype
=
PHAssetCollectionSubtypeSmartAlbumUserLibrary
|
PHAssetCollectionSubtypeSmartAlbumRecentlyAdded
|
PHAssetCollectionSubtypeSmartAlbumVideos
;
// For iOS 9, We need to show ScreenShots Album && SelfPortraits Album
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
f2d090ba
...
...
@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
//
//
version 1.4.4
/*
经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment