Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
7e039949
Commit
7e039949
authored
Jun 21, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 我的名片
parent
8062b2c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
7 deletions
+85
-7
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-0
YHMyGoodFriendsVC.swift
...y/Classes/Modules/Community(社区)/C/YHMyGoodFriendsVC.swift
+11
-0
YHInterestTopicLayout.swift
...asses/Modules/Community(社区)/V/YHInterestTopicLayout.swift
+51
-0
YHMyInterestTopicCell.swift
...asses/Modules/Community(社区)/V/YHMyInterestTopicCell.swift
+17
-5
YHSearchItemLayout.swift
...alaxy/Classes/Modules/Home(首页)/V/YHSearchItemLayout.swift
+2
-2
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
7e039949
...
...
@@ -301,6 +301,7 @@
04AD317B2C2428CB00DF5655
/* YHPeopleSuccessView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AD317A2C2428CB00DF5655
/* YHPeopleSuccessView.swift */
;
};
04AF514E2BEB585C00009E3A
/* YHVideoPlayerVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AF514D2BEB585C00009E3A
/* YHVideoPlayerVC.swift */
;
};
04AF58C42B4FC51C0066011A
/* YHLocalizable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AF58C32B4FC51C0066011A
/* YHLocalizable.swift */
;
};
04AF82D62C25542D0028CE2A
/* YHInterestTopicLayout.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04AF82D52C25542D0028CE2A
/* YHInterestTopicLayout.swift */
;
};
04B9EE5A2C06CC3100A4018D
/* YHCodeSueecssViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04B9EE582C06CC3100A4018D
/* YHCodeSueecssViewController.swift */
;
};
04B9EE5B2C06CC3100A4018D
/* YHOtherLoginViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04B9EE592C06CC3100A4018D
/* YHOtherLoginViewController.swift */
;
};
04C693622B723AB8004C1758
/* YHMySettingViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
;
};
...
...
@@ -849,6 +850,7 @@
04AD317A2C2428CB00DF5655
/* YHPeopleSuccessView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPeopleSuccessView.swift
;
sourceTree
=
"<group>"
;
};
04AF514D2BEB585C00009E3A
/* YHVideoPlayerVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHVideoPlayerVC.swift
;
sourceTree
=
"<group>"
;
};
04AF58C32B4FC51C0066011A
/* YHLocalizable.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLocalizable.swift
;
sourceTree
=
"<group>"
;
};
04AF82D52C25542D0028CE2A
/* YHInterestTopicLayout.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHInterestTopicLayout.swift
;
sourceTree
=
"<group>"
;
};
04B9EE582C06CC3100A4018D
/* YHCodeSueecssViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCodeSueecssViewController.swift
;
sourceTree
=
"<group>"
;
};
04B9EE592C06CC3100A4018D
/* YHOtherLoginViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHOtherLoginViewController.swift
;
sourceTree
=
"<group>"
;
};
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMySettingViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -2176,6 +2178,7 @@
04FB01D32C2404F50040115D
/* YHMyFriendsNoDataView.swift */
,
043BA8742C241B38006EF02D
/* YHAddFriendCardCell.swift */
,
04AD317A2C2428CB00DF5655
/* YHPeopleSuccessView.swift */
,
04AF82D52C25542D0028CE2A
/* YHInterestTopicLayout.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -3255,6 +3258,7 @@
04C693622B723AB8004C1758
/* YHMySettingViewController.swift in Sources */
,
045EEECD2B9F171A0022A143
/* YHScoreDataModel.swift in Sources */
,
A5ACE9342B4564F7002C94D2
/* YHAllApiName.swift in Sources */
,
04AF82D62C25542D0028CE2A
/* YHInterestTopicLayout.swift in Sources */
,
045EEE902B9F171A0022A143
/* YHPreviewInfoNameAndSubNameItemsView.swift in Sources */
,
A5787E342C22B45700B021D7
/* YHActivityListCell.swift in Sources */
,
A567E5B72BD7643D00D5D5A0
/* YHHkLifeAndIdItemView.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMyGoodFriendsVC.swift
View file @
7e039949
...
...
@@ -63,6 +63,16 @@ class YHMyGoodFriendsVC: YHBaseViewController {
make
.
top
.
equalToSuperview
()
.
offset
(
16
+
k_Height_NavigationtBarAndStatuBar
)
}
}
func
createCorner
(
cell
:
UITableViewCell
,
isLastCell
:
Bool
)
{
if
(
isLastCell
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
}
extension
YHMyGoodFriendsVC
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -94,6 +104,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyFriendsCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyFriendsCell
self
.
createCorner
(
cell
:
cell
,
isLastCell
:
indexPath
.
row
==
self
.
friendsArr
.
count
-
1
)
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
friendsArr
.
count
{
}
return
cell
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHInterestTopicLayout.swift
0 → 100644
View file @
7e039949
//
// YHInterestTopicLayout.swift
// galaxy
//
// Created by edy on 2024/6/21.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHInterestTopicLayout
:
UICollectionViewFlowLayout
{
var
interItemSpacing
:
CGFloat
=
12.0
// 相邻单元格之间的水平间距
override
func
prepare
()
{
super
.
prepare
()
self
.
minimumInteritemSpacing
=
12
self
.
minimumLineSpacing
=
8
}
override
func
layoutAttributesForElements
(
in
rect
:
CGRect
)
->
[
UICollectionViewLayoutAttributes
]?
{
let
arrCell
=
super
.
layoutAttributesForElements
(
in
:
rect
)
if
arrCell
==
nil
{
return
nil
}
if
arrCell
!.
count
<=
1
{
return
arrCell
}
for
i
in
1
..<
arrCell
!.
count
{
//当前 UICollectionViewLayoutAttributes
let
currentLayout
=
arrCell
!
[
i
]
//上一个 UICollectionViewLayoutAttributes
let
prevLayout
=
arrCell
!
[
i
-
1
]
if
(
prevLayout
.
indexPath
.
section
==
currentLayout
.
indexPath
.
section
)
{
//我们想设置的最大间距,可根据需要改
let
maximumSpacing
=
12.0
//前一个cell的最右边
let
originX
=
prevLayout
.
frame
.
maxX
//如果当 (上一个cell的最右边X + 我们想要的间距 + 当前cell的宽度 + 区边距) 依然在contentSize中 (小于屏幕宽度),我们改变当前cell的原点位置
//判断 当前cell的 maxX 是否超出屏幕
if
((
CGFloat
(
originX
)
+
CGFloat
(
maximumSpacing
)
+
currentLayout
.
frame
.
size
.
width
)
+
self
.
sectionInset
.
right
<
self
.
collectionViewContentSize
.
width
)
{
var
frame
=
currentLayout
.
frame
frame
.
origin
.
x
=
CGFloat
(
originX
)
+
CGFloat
(
maximumSpacing
)
currentLayout
.
frame
=
frame
}
else
{
print
(
"超出屏幕, 换一行"
)
var
frame
=
currentLayout
.
frame
frame
.
origin
.
x
=
self
.
sectionInset
.
left
currentLayout
.
frame
=
frame
}
}
}
return
arrCell
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHMyInterestTopicCell.swift
View file @
7e039949
...
...
@@ -51,7 +51,7 @@ class YHMyInterestTopicCell: UITableViewCell {
var
editBlock
:
EditBlock
?
static
let
cellReuseIdentifier
=
"YHMyInterestTopicCell"
var
topicArr
:[
String
]
=
[
"深度阅读爱好者"
,
"皮划艇玩家"
,
"创新主义"
,
"茶道
"
,
"皮划艇玩家"
,
"创新主义"
,
"茶道"
,
"深度阅读爱好者
"
]
var
topicArr
:[
String
]
=
[
"深度阅读爱好者"
,
"皮划艇玩家"
,
"创新主义"
,
"茶道
啊大法师额"
,
"皮划艇玩家"
,
"创新主义"
,
"茶道"
,
"深度阅读爱好者"
,
"玩家"
,
"创主义"
,
"茶道"
,
"皮划艇玩家"
,
"创新主义
"
]
lazy
var
cardView
:
UIView
=
{
let
view
=
UIView
()
...
...
@@ -78,13 +78,17 @@ class YHMyInterestTopicCell: UITableViewCell {
return
btn
}()
lazy
var
layout
:
YHInterestTopicLayout
=
{
let
layout
=
YHInterestTopicLayout
()
layout
.
scrollDirection
=
.
vertical
return
layout
}()
lazy
var
collectionView
:
UICollectionView
=
{
// 创建集合视图布局
let
layout
=
YHSearchItemLayout
()
layout
.
scrollDirection
=
.
vertical
// 创建集合视图
let
collectView
=
UICollectionView
(
frame
:
.
zero
,
collectionViewLayout
:
layout
)
let
collectView
=
UICollectionView
(
frame
:
.
zero
,
collectionViewLayout
:
self
.
layout
)
collectView
.
delegate
=
self
collectView
.
dataSource
=
self
collectView
.
backgroundColor
=
.
white
...
...
@@ -111,6 +115,7 @@ class YHMyInterestTopicCell: UITableViewCell {
self
.
contentView
.
addSubview
(
self
.
cardView
)
cardView
.
addSubview
(
self
.
titleLabel
)
cardView
.
addSubview
(
collectionView
)
cardView
.
addSubview
(
self
.
editBtn
)
cardView
.
snp
.
makeConstraints
{
make
in
...
...
@@ -133,9 +138,16 @@ class YHMyInterestTopicCell: UITableViewCell {
make
.
left
.
equalTo
(
16
)
make
.
right
.
equalTo
(
-
16
)
make
.
bottom
.
equalTo
(
-
16
)
make
.
height
.
equalTo
(
58
)
make
.
height
.
equalTo
(
24
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
12
)
}
collectionView
.
reloadData
{
let
height
=
self
.
collectionView
.
contentSize
.
height
self
.
collectionView
.
snp
.
updateConstraints
{
make
in
make
.
height
.
equalTo
(
height
)
}
}
}
@objc
func
edit
()
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHSearchItemLayout.swift
View file @
7e039949
...
...
@@ -11,10 +11,10 @@ import UIKit
class
YHSearchItemLayout
:
UICollectionViewFlowLayout
{
var
interItemSpacing
:
CGFloat
=
12.0
// 相邻单元格之间的水平间距
override
func
prepare
()
{
super
.
prepare
()
self
.
minimumInteritemSpacing
=
12
self
.
minimumLineSpacing
=
10
}
override
func
layoutAttributesForElements
(
in
rect
:
CGRect
)
->
[
UICollectionViewLayoutAttributes
]?
{
...
...
@@ -37,6 +37,7 @@ class YHSearchItemLayout: UICollectionViewFlowLayout {
var
frame
=
currentLayout
.
frame
frame
.
origin
.
x
=
CGFloat
(
originX
)
+
CGFloat
(
maximumSpacing
)
currentLayout
.
frame
=
frame
}
else
{
print
(
"超出屏幕, 换一行"
)
var
frame
=
currentLayout
.
frame
...
...
@@ -47,5 +48,4 @@ class YHSearchItemLayout: UICollectionViewFlowLayout {
}
return
arrCell
}
}
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