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
7b5944f0
Commit
7b5944f0
authored
Dec 08, 2016
by
banchichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.6 加入同步和共享相册
parent
c100f4df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
24 deletions
+18
-24
TZImagePickerController/Info.plist
TZImagePickerController/Info.plist
+1
-1
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+15
-21
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+1
-1
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+1
-1
No files found.
TZImagePickerController/Info.plist
View file @
7b5944f0
...
...
@@ -15,7 +15,7 @@
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.7.
5
</string>
<string>
1.7.
6
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
...
...
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
7b5944f0
...
...
@@ -122,29 +122,23 @@ static CGFloat TZScreenScale;
PHFetchResult
*
myPhotoStreamAlbum
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeAlbumMyPhotoStream
options
:
nil
];
PHFetchResult
*
smartAlbums
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeAlbumRegular
options
:
nil
];
PHFetchResult
*
topLevelUserCollections
=
[
PHCollectionList
fetchTopLevelUserCollectionsWithOptions
:
nil
];
for
(
PHAssetCollection
*
collection
in
myPhotoStreamAlbum
)
{
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
];
if
(
fetchResult
.
count
<
1
)
continue
;
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
}
for
(
PHAssetCollection
*
collection
in
smartAlbums
)
{
// 有可能是PHCollectionList类的的对象,过滤掉
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
]
;
if
(
fetchResult
.
count
<
1
)
continue
;
if
([
collection
.
localizedTitle
containsString
:
@"Deleted"
]
||
[
collection
.
localizedTitle
isEqualToString
:
@"最近删除"
])
continue
;
if
([
self
isCameraRollAlbum
:
collection
.
localizedTitle
])
{
[
albumArr
insertObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]
atIndex
:
0
];
}
else
{
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
PHFetchResult
*
syncedAlbums
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeAlbumSyncedAlbum
options
:
nil
];
PHFetchResult
*
sharedAlbums
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeAlbumCloudShared
options
:
nil
];
NSArray
*
allAlbums
=
@[
myPhotoStreamAlbum
,
smartAlbums
,
topLevelUserCollections
,
syncedAlbums
,
sharedAlbums
]
;
for
(
PHFetchResult
*
fetchResult
in
allAlbums
)
{
for
(
PHAssetCollection
*
collection
in
fetchResult
)
{
// 有可能是PHCollectionList类的的对象,过滤掉
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
]
;
if
(
fetchResult
.
count
<
1
)
continue
;
if
([
collection
.
localizedTitle
containsString
:
@"Deleted"
]
||
[
collection
.
localizedTitle
isEqualToString
:
@"最近删除"
]
)
continue
;
if
([
self
isCameraRollAlbum
:
collection
.
localizedTitle
])
{
[
albumArr
insertObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]
atIndex
:
0
];
}
else
{
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
}
}
}
for
(
PHAssetCollection
*
collection
in
topLevelUserCollections
)
{
if
(
!
[
collection
isKindOfClass
:[
PHAssetCollection
class
]])
continue
;
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
];
if
(
fetchResult
.
count
<
1
)
continue
;
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
}
if
(
completion
&&
albumArr
.
count
>
0
)
completion
(
albumArr
);
}
else
{
[
self
.
assetLibrary
enumerateGroupsWithTypes
:
ALAssetsGroupAll
usingBlock
:
^
(
ALAssetsGroup
*
group
,
BOOL
*
stop
)
{
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
7b5944f0
...
...
@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 1.7.
5 - 2016.12.7
// version 1.7.
6 - 2016.12.8
/*
经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右)
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
7b5944f0
...
...
@@ -4,7 +4,7 @@
//
// Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved.
// version 1.7.
5 - 2016.12.7
// version 1.7.
6 - 2016.12.8
#import "TZImagePickerController.h"
#import "TZPhotoPickerController.h"
...
...
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