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
739cd943
Commit
739cd943
authored
Jun 29, 2016
by
Zhen Tan
Committed by
GitHub
Jun 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #103 from lastObject/master
获取相册时候增加了一个判断,避免崩溃
parents
231d9cea
2fa670b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+10
-2
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
739cd943
...
...
@@ -125,10 +125,14 @@ static CGFloat TZScreenScale;
PHFetchResult
*
fetchResult
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
option
];
if
(
fetchResult
.
count
<
1
)
continue
;
if
([
collection
.
localizedTitle
isEqualToString
:
@"My Photo Stream"
]
||
[
collection
.
localizedTitle
isEqualToString
:
@"我的照片流"
])
{
if
(
albumArr
.
count
)
{
[
albumArr
insertObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]
atIndex
:
1
];
}
else
{
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
}
}
else
{
[
albumArr
addObject
:[
self
modelWithResult
:
fetchResult
name
:
collection
.
localizedTitle
]];
}
}
if
(
completion
&&
albumArr
.
count
>
0
)
completion
(
albumArr
);
}
else
{
...
...
@@ -141,10 +145,14 @@ static CGFloat TZScreenScale;
if
([
name
isEqualToString
:
@"Camera Roll"
]
||
[
name
isEqualToString
:
@"相机胶卷"
]
||
[
name
isEqualToString
:
@"所有照片"
]
||
[
name
isEqualToString
:
@"All Photos"
])
{
[
albumArr
insertObject
:[
self
modelWithResult
:
group
name
:
name
]
atIndex
:
0
];
}
else
if
([
name
isEqualToString
:
@"My Photo Stream"
]
||
[
name
isEqualToString
:
@"我的照片流"
])
{
if
(
albumArr
.
count
)
{
[
albumArr
insertObject
:[
self
modelWithResult
:
group
name
:
name
]
atIndex
:
1
];
}
else
{
[
albumArr
addObject
:[
self
modelWithResult
:
group
name
:
name
]];
}
}
else
{
[
albumArr
addObject
:[
self
modelWithResult
:
group
name
:
name
]];
}
}
failureBlock
:
nil
];
}
}
...
...
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