Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
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
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
5caefc91
Commit
5caefc91
authored
Jun 30, 2021
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
32
parent
66f4791b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Other/HGImage/HGImagePickerController.swift
...inessPlatform/Other/HGImage/HGImagePickerController.swift
+17
-14
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
5caefc91
No preview for this file type
GeliBusinessPlatform/Other/HGImage/HGImagePickerController.swift
View file @
5caefc91
...
@@ -81,12 +81,14 @@ class HGImagePickerController: UIViewController {
...
@@ -81,12 +81,14 @@ class HGImagePickerController: UIViewController {
private
func
convertCollection
(
collection
:
PHFetchResult
<
PHAssetCollection
>
){
private
func
convertCollection
(
collection
:
PHFetchResult
<
PHAssetCollection
>
){
for
i
in
0
..<
collection
.
count
{
for
i
in
0
..<
collection
.
count
{
//获取出但前相簿内的图片
//获取出但前相簿内的图片
let
resultsOptions
=
PHFetchOptions
()
let
resultsOptions
=
PHFetchOptions
()
resultsOptions
.
sortDescriptors
=
[
NSSortDescriptor
(
key
:
"creationDate"
,
resultsOptions
.
sortDescriptors
=
[
NSSortDescriptor
(
key
:
"creationDate"
,
ascending
:
false
)]
ascending
:
false
)]
resultsOptions
.
predicate
=
NSPredicate
(
format
:
"mediaType = %d"
,
resultsOptions
.
predicate
=
NSPredicate
(
format
:
"mediaType = %d"
,
PHAssetMediaType
.
image
.
rawValue
)
PHAssetMediaType
.
image
.
rawValue
)
let
c
=
collection
[
i
]
let
c
=
collection
[
i
]
if
c
.
isKind
(
of
:
PHAssetCollection
.
self
){
let
assetsFetchResult
=
PHAsset
.
fetchAssets
(
in
:
c
,
options
:
resultsOptions
)
let
assetsFetchResult
=
PHAsset
.
fetchAssets
(
in
:
c
,
options
:
resultsOptions
)
//没有图片的空相簿不显示
//没有图片的空相簿不显示
if
assetsFetchResult
.
count
>
0
{
if
assetsFetchResult
.
count
>
0
{
...
@@ -96,6 +98,7 @@ class HGImagePickerController: UIViewController {
...
@@ -96,6 +98,7 @@ class HGImagePickerController: UIViewController {
}
}
}
}
}
}
}
//由于系统返回的相册集名称为英文,我们需要转换为中文
//由于系统返回的相册集名称为英文,我们需要转换为中文
private
func
titleOfAlbumForChinse
(
title
:
String
?)
->
String
?
{
private
func
titleOfAlbumForChinse
(
title
:
String
?)
->
String
?
{
...
...
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