Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PhoneManager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yang
PhoneManager
Commits
36283345
Commit
36283345
authored
May 21, 2025
by
CZ1004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【优化】时间选择器
parent
545b78fb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
286 additions
and
110 deletions
+286
-110
PhotoRemoveViewController.swift
...lass/Page/Home/Controller/PhotoRemoveViewController.swift
+10
-4
DateSelectButtonView.swift
PhoneManager/Class/Page/Home/View/DateSelectButtonView.swift
+1
-1
PhotosRemoveBaseView.swift
PhoneManager/Class/Page/Home/View/PhotosRemoveBaseView.swift
+44
-19
ResourceFilterBoxView.swift
...eManager/Class/Page/Home/View/ResourceFilterBoxView.swift
+18
-7
YearMonthPickerView.swift
PhoneManager/Class/Page/Home/View/YearMonthPickerView.swift
+204
-70
HomeInfoTableViewCell.swift
...ger/Class/Page/Home/View/cell/HomeInfoTableViewCell.swift
+2
-0
PMShowImgVideoController.swift
...eManager/Class/Page/Secret/PMShowImgVideoController.swift
+7
-9
No files found.
PhoneManager/Class/Page/Home/Controller/PhotoRemoveViewController.swift
View file @
36283345
...
@@ -316,17 +316,19 @@ class PhotoRemoveViewController: BaseViewController {
...
@@ -316,17 +316,19 @@ class PhotoRemoveViewController: BaseViewController {
func
showTrashView
(){
func
showTrashView
(){
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
self
.
trashSubView
.
isHidden
=
false
self
.
trashSubView
.
isHidden
=
false
UIView
.
animate
(
withDuration
:
0.
1
)
{
UIView
.
animate
(
withDuration
:
0.
2
)
{
// 更新约束
// 更新约束
self
.
bottomConstraint
?
.
update
(
offset
:
0
)
self
.
bottomConstraint
?
.
update
(
offset
:
0
)
self
.
view
.
layoutIfNeeded
()
}
}
}
}
}
}
func
hideTrashView
(){
func
hideTrashView
(){
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
UIView
.
animate
(
withDuration
:
0.
1
)
{
UIView
.
animate
(
withDuration
:
0.
2
)
{
// 更新约束
// 更新约束
self
.
bottomConstraint
?
.
update
(
offset
:
78
+
safeHeight
)
self
.
bottomConstraint
?
.
update
(
offset
:
78
+
safeHeight
)
self
.
view
.
layoutIfNeeded
()
}
completion
:
{
finished
in
}
completion
:
{
finished
in
self
.
trashSubView
.
isHidden
=
true
self
.
trashSubView
.
isHidden
=
true
}
}
...
@@ -431,9 +433,13 @@ class PhotoRemoveViewController: BaseViewController {
...
@@ -431,9 +433,13 @@ class PhotoRemoveViewController: BaseViewController {
func
saveDataToKeepListDB
(){
func
saveDataToKeepListDB
(){
if
let
type
=
self
.
mediaType
{
if
let
type
=
self
.
mediaType
{
if
let
dataSg
=
Singleton
.
shared
.
keepList
[
type
]{
if
let
dataSg
=
Singleton
.
shared
.
keepList
[
type
]{
var
uinqueId
=
UUID
()
.
uuidString
for
item
in
dataSg
{
for
item
in
dataSg
{
// 如果是视频的话不会进行分组,所以每次传入不同的id组
if
type
==
.
video
{
let
uinqueId
=
UUID
()
.
uuidString
// 如果是视频的话不会进行分组,所以每次传入不同的id
// 重新生成一个
uinqueId
=
UUID
()
.
uuidString
}
let
success
=
GroupDatabase
.
shared
.
insert
(
localIdentifier
:
item
.
localIdentifier
,
assetSize
:
item
.
assetSize
,
createDate
:
item
.
createDate
,
mediaType
:
type
==
TrashTypeEnum
.
video
?
2
:
1
,
groupId
:
uinqueId
)
let
success
=
GroupDatabase
.
shared
.
insert
(
localIdentifier
:
item
.
localIdentifier
,
assetSize
:
item
.
assetSize
,
createDate
:
item
.
createDate
,
mediaType
:
type
==
TrashTypeEnum
.
video
?
2
:
1
,
groupId
:
uinqueId
)
if
success
==
false
{
if
success
==
false
{
Print
(
"保留单利数据到数据库保留列表失败"
)
Print
(
"保留单利数据到数据库保留列表失败"
)
...
...
PhoneManager/Class/Page/Home/View/DateSelectButtonView.swift
View file @
36283345
...
@@ -11,7 +11,7 @@ class DateSelectButtonView : UIView {
...
@@ -11,7 +11,7 @@ class DateSelectButtonView : UIView {
var
closeCallBack
:
()
->
Void
=
{}
var
closeCallBack
:
()
->
Void
=
{}
var
type
:
PikerDateType
?
var
type
:
Pi
c
kerDateType
?
lazy
var
dateButton
:
UIButton
=
{
lazy
var
dateButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
let
button
=
UIButton
(
type
:
.
custom
)
...
...
PhoneManager/Class/Page/Home/View/PhotosRemoveBaseView.swift
View file @
36283345
...
@@ -21,15 +21,19 @@ class PhotosRemoveBaseView: UIView {
...
@@ -21,15 +21,19 @@ class PhotosRemoveBaseView: UIView {
func
reload
(
index
:
Int
)
->
Void
{
func
reload
(
index
:
Int
)
->
Void
{
if
let
url
=
url
{
if
let
url
=
url
{
self
.
innerVideoController
=
VideoViewController
()
if
self
.
innerVideoController
==
nil
{
if
let
vc
=
self
.
innerVideoController
{
self
.
innerVideoController
=
VideoViewController
()
vc
.
isAutoPlay
=
index
==
0
if
let
vc
=
self
.
innerVideoController
{
vc
.
url
=
url
vc
.
isAutoPlay
=
index
==
0
self
.
imageView
.
removeFromSuperview
()
vc
.
url
=
url
self
.
addSubview
(
vc
.
view
)
self
.
imageView
.
removeFromSuperview
()
vc
.
view
.
snp
.
makeConstraints
{
make
in
self
.
addSubview
(
vc
.
view
)
make
.
left
.
top
.
bottom
.
right
.
equalToSuperview
()
vc
.
view
.
snp
.
makeConstraints
{
make
in
make
.
left
.
top
.
bottom
.
right
.
equalToSuperview
()
}
}
}
}
else
{
self
.
innerVideoController
?
.
playerViewController
.
player
?
.
play
()
}
}
}
}
}
}
...
@@ -72,7 +76,11 @@ class PhotosRemoveBaseView: UIView {
...
@@ -72,7 +76,11 @@ class PhotosRemoveBaseView: UIView {
addSubview
(
imageView
)
addSubview
(
imageView
)
leftButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
95
,
height
:
42
)
leftButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
95
,
height
:
42
)
leftButton
.
center
=
imageView
.
center
if
self
.
url
!=
nil
{
self
.
leftButton
.
center
=
self
.
innerVideoController
?
.
view
.
center
??
imageView
.
center
}
else
{
self
.
leftButton
.
center
=
imageView
.
center
}
leftButton
.
setTitle
(
"Delete"
,
for
:
.
normal
)
leftButton
.
setTitle
(
"Delete"
,
for
:
.
normal
)
leftButton
.
backgroundColor
=
UIColor
(
red
:
0.95
,
green
:
0.21
,
blue
:
0.21
,
alpha
:
1
)
leftButton
.
backgroundColor
=
UIColor
(
red
:
0.95
,
green
:
0.21
,
blue
:
0.21
,
alpha
:
1
)
leftButton
.
tintColor
=
.
white
leftButton
.
tintColor
=
.
white
...
@@ -83,7 +91,11 @@ class PhotosRemoveBaseView: UIView {
...
@@ -83,7 +91,11 @@ class PhotosRemoveBaseView: UIView {
rightButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
95
,
height
:
42
)
rightButton
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
95
,
height
:
42
)
rightButton
.
center
=
imageView
.
center
if
self
.
url
!=
nil
{
self
.
rightButton
.
center
=
self
.
innerVideoController
?
.
view
.
center
??
imageView
.
center
}
else
{
self
.
rightButton
.
center
=
imageView
.
center
}
rightButton
.
setTitle
(
"Retain"
,
for
:
.
normal
)
rightButton
.
setTitle
(
"Retain"
,
for
:
.
normal
)
rightButton
.
backgroundColor
=
UIColor
(
red
:
0.18
,
green
:
0.76
,
blue
:
0.35
,
alpha
:
1
)
rightButton
.
backgroundColor
=
UIColor
(
red
:
0.18
,
green
:
0.76
,
blue
:
0.35
,
alpha
:
1
)
rightButton
.
tintColor
=
.
white
rightButton
.
tintColor
=
.
white
...
@@ -101,17 +113,24 @@ class PhotosRemoveBaseView: UIView {
...
@@ -101,17 +113,24 @@ class PhotosRemoveBaseView: UIView {
}
}
func
showLeftButton
()
{
func
showLeftButton
()
{
self
.
leftButton
.
center
=
imageView
.
center
if
self
.
url
!=
nil
{
UIView
.
animate
(
withDuration
:
0.2
)
{
self
.
leftButton
.
center
=
self
.
innerVideoController
?
.
view
.
center
??
imageView
.
center
self
.
leftButton
.
alpha
=
1
}
else
{
self
.
maskTempleteView
.
backgroundColor
=
UIColor
(
red
:
0.95
,
green
:
0.21
,
blue
:
0.21
,
alpha
:
0.4000
)
self
.
leftButton
.
center
=
imageView
.
center
self
.
addSubview
(
self
.
maskTempleteView
)
self
.
rightButton
.
alpha
=
0
}
}
self
.
leftButton
.
alpha
=
1
self
.
rightButton
.
alpha
=
0
self
.
maskTempleteView
.
backgroundColor
=
UIColor
(
red
:
0.95
,
green
:
0.21
,
blue
:
0.21
,
alpha
:
0.4000
)
self
.
addSubview
(
self
.
maskTempleteView
)
}
}
func
showRightButton
()
{
func
showRightButton
()
{
self
.
rightButton
.
center
=
imageView
.
center
if
self
.
url
!=
nil
{
self
.
rightButton
.
center
=
self
.
innerVideoController
?
.
view
.
center
??
imageView
.
center
}
else
{
self
.
rightButton
.
center
=
imageView
.
center
}
UIView
.
animate
(
withDuration
:
0.2
)
{
UIView
.
animate
(
withDuration
:
0.2
)
{
self
.
rightButton
.
alpha
=
1
self
.
rightButton
.
alpha
=
1
self
.
maskTempleteView
.
backgroundColor
=
UIColor
(
red
:
0.26
,
green
:
0.78
,
blue
:
0.41
,
alpha
:
0.4000
)
self
.
maskTempleteView
.
backgroundColor
=
UIColor
(
red
:
0.26
,
green
:
0.78
,
blue
:
0.41
,
alpha
:
0.4000
)
...
@@ -121,12 +140,18 @@ class PhotosRemoveBaseView: UIView {
...
@@ -121,12 +140,18 @@ class PhotosRemoveBaseView: UIView {
}
}
func
hideButtons
()
{
func
hideButtons
()
{
UIView
.
animate
(
withDuration
:
0.2
)
{
[
self
]
in
UIView
.
animate
(
withDuration
:
0.2
)
{
[
self
]
in
self
.
leftButton
.
alpha
=
0
self
.
leftButton
.
alpha
=
0
self
.
rightButton
.
alpha
=
0
self
.
rightButton
.
alpha
=
0
self
.
maskTempleteView
.
removeFromSuperview
()
self
.
maskTempleteView
.
removeFromSuperview
()
self
.
leftButton
.
center
=
self
.
imageView
.
center
if
self
.
url
!=
nil
{
self
.
rightButton
.
center
=
self
.
imageView
.
center
self
.
rightButton
.
center
=
self
.
innerVideoController
?
.
view
.
center
??
imageView
.
center
self
.
leftButton
.
center
=
self
.
innerVideoController
?
.
view
.
center
??
imageView
.
center
}
else
{
self
.
leftButton
.
center
=
self
.
imageView
.
center
self
.
rightButton
.
center
=
self
.
imageView
.
center
}
}
}
}
}
...
...
PhoneManager/Class/Page/Home/View/ResourceFilterBoxView.swift
View file @
36283345
...
@@ -127,8 +127,8 @@ class ResourceFilterBoxView : UIView {
...
@@ -127,8 +127,8 @@ class ResourceFilterBoxView : UIView {
private
func
setDefaultDataInPage
(){
private
func
setDefaultDataInPage
(){
// 设置按钮
// 设置按钮
resetByType
(
date
:
self
.
startDate
,
type
:
PikerDateType
.
start
)
resetByType
(
date
:
self
.
startDate
,
type
:
Pi
c
kerDateType
.
start
)
resetByType
(
date
:
self
.
endDate
,
type
:
PikerDateType
.
end
)
resetByType
(
date
:
self
.
endDate
,
type
:
Pi
c
kerDateType
.
end
)
// 设置选择框
// 设置选择框
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
...
@@ -141,7 +141,7 @@ class ResourceFilterBoxView : UIView {
...
@@ -141,7 +141,7 @@ class ResourceFilterBoxView : UIView {
/// - Parameters:
/// - Parameters:
/// - date: 时间
/// - date: 时间
/// - type: 类型
/// - type: 类型
private
func
resetByType
(
date
:
Date
?,
type
:
PikerDateType
){
private
func
resetByType
(
date
:
Date
?,
type
:
Pi
c
kerDateType
){
if
let
date
=
date
{
if
let
date
=
date
{
let
timeNumber
=
getYearAndMonthFromDate
(
currentDate
:
date
)
let
timeNumber
=
getYearAndMonthFromDate
(
currentDate
:
date
)
if
let
year
=
timeNumber
.
0
{
if
let
year
=
timeNumber
.
0
{
...
@@ -167,13 +167,14 @@ class ResourceFilterBoxView : UIView {
...
@@ -167,13 +167,14 @@ class ResourceFilterBoxView : UIView {
/// - year: 年
/// - year: 年
/// - month: 月
/// - month: 月
/// - type: 按钮类型
/// - type: 按钮类型
func
resetDateStringFromYearAndMonth
(
year
:
Int
,
month
:
Int
,
type
:
PikerDateType
){
func
resetDateStringFromYearAndMonth
(
year
:
Int
,
month
:
Int
,
type
:
Pi
c
kerDateType
){
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
if
type
==
.
start
{
if
type
==
.
start
{
self
.
startDateButton
.
dateButton
.
setTitle
(
"From
\(
self
.
getMonthEn
(
month
:
month
)
)
\(
year
)
"
,
for
:
.
normal
)
self
.
startDateButton
.
dateButton
.
setTitle
(
"From
\(
self
.
getMonthEn
(
month
:
month
)
)
\(
year
)
"
,
for
:
.
normal
)
self
.
startDateButton
.
closeButton
.
isHidden
=
false
self
.
startDateButton
.
closeButton
.
isHidden
=
false
self
.
startDate
=
self
.
dateFrom
(
year
:
year
,
month
:
month
)
self
.
startDate
=
self
.
dateFrom
(
year
:
year
,
month
:
month
)
}
else
{
}
else
{
// 判断结束时间是否大于开始时间,如果是
self
.
endDateButton
.
dateButton
.
setTitle
(
"To
\(
self
.
getMonthEn
(
month
:
month
)
)
\(
year
)
"
,
for
:
.
normal
)
self
.
endDateButton
.
dateButton
.
setTitle
(
"To
\(
self
.
getMonthEn
(
month
:
month
)
)
\(
year
)
"
,
for
:
.
normal
)
self
.
endDateButton
.
closeButton
.
isHidden
=
false
self
.
endDateButton
.
closeButton
.
isHidden
=
false
self
.
endDate
=
self
.
lastDayOfMonth
(
year
:
year
,
month
:
month
)
self
.
endDate
=
self
.
lastDayOfMonth
(
year
:
year
,
month
:
month
)
...
@@ -214,9 +215,13 @@ class ResourceFilterBoxView : UIView {
...
@@ -214,9 +215,13 @@ class ResourceFilterBoxView : UIView {
self
.
startDateButton
.
closeCallBack
=
{
self
.
startDateButton
.
closeCallBack
=
{
self
.
startDate
=
nil
self
.
startDate
=
nil
self
.
datePicker
?
.
startDate
=
nil
self
.
datePicker
?
.
reloadData
()
}
}
self
.
endDateButton
.
closeCallBack
=
{
self
.
endDateButton
.
closeCallBack
=
{
self
.
endDate
=
nil
self
.
endDate
=
nil
self
.
datePicker
?
.
endDate
=
nil
self
.
datePicker
?
.
reloadData
()
}
}
self
.
startDateButton
.
reSetButtonTitle
()
self
.
startDateButton
.
reSetButtonTitle
()
...
@@ -348,18 +353,24 @@ class ResourceFilterBoxView : UIView {
...
@@ -348,18 +353,24 @@ class ResourceFilterBoxView : UIView {
popDatePikerView
(
type
:
.
end
)
popDatePikerView
(
type
:
.
end
)
}
}
func
popDatePikerView
(
type
:
PikerDateType
){
func
popDatePikerView
(
type
:
Pi
c
kerDateType
){
showDatePicker
(
type
:
type
)
showDatePicker
(
type
:
type
,
startDate
:
self
.
startDate
,
endDate
:
self
.
endDate
)
}
}
// 显示
// 显示
func
showDatePicker
(
type
:
Pi
kerDateType
){
func
showDatePicker
(
type
:
Pi
ckerDateType
,
startDate
:
Date
?,
endDate
:
Date
?
){
if
self
.
datePicker
!=
nil
{
if
self
.
datePicker
!=
nil
{
self
.
datePicker
?
.
type
=
type
self
.
datePicker
?
.
type
=
type
self
.
datePicker
?
.
startDate
=
self
.
startDate
self
.
datePicker
?
.
endDate
=
self
.
endDate
self
.
datePicker
?
.
reloadData
()
return
return
}
}
self
.
datePicker
=
YearMonthPickerView
()
self
.
datePicker
=
YearMonthPickerView
()
self
.
datePicker
?
.
type
=
type
self
.
datePicker
?
.
type
=
type
self
.
datePicker
?
.
startDate
=
self
.
startDate
self
.
datePicker
?
.
endDate
=
self
.
endDate
self
.
datePicker
?
.
backgroundColor
=
.
white
self
.
datePicker
?
.
backgroundColor
=
.
white
if
let
window
=
cWindow
,
let
datePicker
=
self
.
datePicker
{
if
let
window
=
cWindow
,
let
datePicker
=
self
.
datePicker
{
let
datePickerFrame
=
CGRect
(
x
:
0
,
y
:
window
.
height
,
width
:
window
.
width
,
height
:
204
)
let
datePickerFrame
=
CGRect
(
x
:
0
,
y
:
window
.
height
,
width
:
window
.
width
,
height
:
204
)
...
...
PhoneManager/Class/Page/Home/View/YearMonthPickerView.swift
View file @
36283345
This diff is collapsed.
Click to expand it.
PhoneManager/Class/Page/Home/View/cell/HomeInfoTableViewCell.swift
View file @
36283345
...
@@ -268,6 +268,8 @@ extension HomeInfoTableViewCell:UICollectionViewDelegate,UICollectionViewDataSou
...
@@ -268,6 +268,8 @@ extension HomeInfoTableViewCell:UICollectionViewDelegate,UICollectionViewDataSou
let
vc
=
PMShowImgVideoController
()
let
vc
=
PMShowImgVideoController
()
if
model
?
.
type
==
.
SimilarVideos
||
model
?
.
type
==
.
videos
{
if
model
?
.
type
==
.
SimilarVideos
||
model
?
.
type
==
.
videos
{
vc
.
state
=
.
similarVideos
vc
.
state
=
.
similarVideos
}
else
if
model
?
.
type
==
.
duplicates
{
vc
.
state
=
.
duplicates
}
else
{
}
else
{
vc
.
state
=
.
similarPhotos
vc
.
state
=
.
similarPhotos
}
}
...
...
PhoneManager/Class/Page/Secret/PMShowImgVideoController.swift
View file @
36283345
...
@@ -16,6 +16,8 @@ class PMShowImgVideoController: BaseViewController {
...
@@ -16,6 +16,8 @@ class PMShowImgVideoController: BaseViewController {
case
similarPhotos
case
similarPhotos
// 相似视频
// 相似视频
case
similarVideos
case
similarVideos
// 重复项
case
duplicates
}
}
// 资源类型 0-图片 1-视频
// 资源类型 0-图片 1-视频
...
@@ -290,11 +292,9 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
...
@@ -290,11 +292,9 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
showName
.
loadPhotoOrVideo
{
durs
,
icon
in
showName
.
loadPhotoOrVideo
{
durs
,
icon
in
cell
.
icon
=
icon
cell
.
icon
=
icon
}
}
if
let
data
=
self
.
homeDataSource
{
cell
.
bestResultButton
.
isHidden
=
true
cell
.
bestResultButton
.
isHidden
=
indexPath
.
row
!=
0
||
data
.
count
<=
1
if
self
.
homeDataSource
==
nil
{
}
else
{
cell
.
selectBtn
.
isHidden
=
true
cell
.
selectBtn
.
isHidden
=
true
cell
.
bestResultButton
.
isHidden
=
true
}
}
cell
.
isCurrent
=
selectSet
.
contains
(
indexPath
.
row
)
cell
.
isCurrent
=
selectSet
.
contains
(
indexPath
.
row
)
cell
.
callblock
=
{[
weak
self
]
in
cell
.
callblock
=
{[
weak
self
]
in
...
@@ -334,9 +334,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
...
@@ -334,9 +334,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
}
}
}
else
{
}
else
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
PMShowItemCellID
,
for
:
indexPath
)
as!
PMShowItemCell
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
PMShowItemCellID
,
for
:
indexPath
)
as!
PMShowItemCell
if
let
data
=
self
.
homeDataSource
{
if
self
.
homeDataSource
==
nil
{
}
else
{
cell
.
selectBtn
.
isHidden
=
true
cell
.
selectBtn
.
isHidden
=
true
}
}
showName
.
loadPhotoOrVideo
{
duration
,
icon
in
showName
.
loadPhotoOrVideo
{
duration
,
icon
in
...
@@ -349,14 +347,14 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
...
@@ -349,14 +347,14 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
}
}
}
}
if
state
==
.
similarPhotos
{
if
state
==
.
similarPhotos
||
state
==
.
duplicates
{
if
collectionView
==
MaxCollection
{
if
collectionView
==
MaxCollection
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
PMShowImgCellID
,
for
:
indexPath
)
as!
PMShowImgCell
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
PMShowImgCellID
,
for
:
indexPath
)
as!
PMShowImgCell
cell
.
icon
=
self
.
homeDataSource
!
[
indexPath
.
row
]
.
image
??
UIImage
()
cell
.
icon
=
self
.
homeDataSource
!
[
indexPath
.
row
]
.
image
??
UIImage
()
cell
.
isCurrent
=
selectSet
.
contains
(
indexPath
.
row
)
cell
.
isCurrent
=
selectSet
.
contains
(
indexPath
.
row
)
if
let
data
=
self
.
homeDataSource
{
if
let
data
=
self
.
homeDataSource
{
cell
.
bestResultButton
.
isHidden
=
indexPath
.
row
!=
0
||
data
.
count
<=
1
cell
.
bestResultButton
.
isHidden
=
indexPath
.
row
!=
0
||
data
.
count
<=
1
||
state
==
.
duplicates
}
}
cell
.
callblock
=
{[
weak
self
]
in
cell
.
callblock
=
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
...
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