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
ecc5dafd
Commit
ecc5dafd
authored
Sep 30, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 标签
parent
27ebf5e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
29 deletions
+60
-29
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-0
YHInterestTopicLayout.swift
...asses/Modules/Community(社区)/V/YHInterestTopicLayout.swift
+14
-27
YHMyInterestTopicCell.swift
...asses/Modules/Community(社区)/V/YHMyInterestTopicCell.swift
+2
-2
YHTagCollectionView.swift
...Classes/Modules/Community(社区)/V/YHTagCollectionView.swift
+23
-0
YHTagFlowLayout.swift
...axy/Classes/Modules/Community(社区)/V/YHTagFlowLayout.swift
+13
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
ecc5dafd
...
@@ -1302,6 +1302,8 @@
...
@@ -1302,6 +1302,8 @@
04D8FFB62DAE489A00703C75
/* YHVisitHKAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D8FFB52DAE489A00703C75
/* YHVisitHKAlertView.swift */
;
};
04D8FFB62DAE489A00703C75
/* YHVisitHKAlertView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D8FFB52DAE489A00703C75
/* YHVisitHKAlertView.swift */
;
};
04D8FFB82DB0D50B00703C75
/* YHGalaxyNewsListViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D8FFB72DB0D50B00703C75
/* YHGalaxyNewsListViewController.swift */
;
};
04D8FFB82DB0D50B00703C75
/* YHGalaxyNewsListViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D8FFB72DB0D50B00703C75
/* YHGalaxyNewsListViewController.swift */
;
};
04D8FFBA2DB0D95A00703C75
/* YHGalaxyNewsCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D8FFB92DB0D95A00703C75
/* YHGalaxyNewsCell.swift */
;
};
04D8FFBA2DB0D95A00703C75
/* YHGalaxyNewsCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D8FFB92DB0D95A00703C75
/* YHGalaxyNewsCell.swift */
;
};
04DFB6F02E8BA8D1008EC0EB
/* YHTagFlowLayout.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04DFB6EF2E8BA8D1008EC0EB
/* YHTagFlowLayout.swift */
;
};
04DFB6F22E8BAA1C008EC0EB
/* YHTagCollectionView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04DFB6F12E8BAA1C008EC0EB
/* YHTagCollectionView.swift */
;
};
04E0D3C82E866A6300F1824B
/* YHCirclePhotoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E0D3C72E866A6300F1824B
/* YHCirclePhotoCell.swift */
;
};
04E0D3C82E866A6300F1824B
/* YHCirclePhotoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E0D3C72E866A6300F1824B
/* YHCirclePhotoCell.swift */
;
};
04E0D3CA2E866A9800F1824B
/* YHCircleAddPhotoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E0D3C92E866A9800F1824B
/* YHCircleAddPhotoCell.swift */
;
};
04E0D3CA2E866A9800F1824B
/* YHCircleAddPhotoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E0D3C92E866A9800F1824B
/* YHCircleAddPhotoCell.swift */
;
};
04E0D3CC2E877D4D00F1824B
/* YHMediaUploadSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E0D3CB2E877D4D00F1824B
/* YHMediaUploadSheetView.swift */
;
};
04E0D3CC2E877D4D00F1824B
/* YHMediaUploadSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E0D3CB2E877D4D00F1824B
/* YHMediaUploadSheetView.swift */
;
};
...
@@ -2674,6 +2676,8 @@
...
@@ -2674,6 +2676,8 @@
04D8FFB52DAE489A00703C75
/* YHVisitHKAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHVisitHKAlertView.swift
;
sourceTree
=
"<group>"
;
};
04D8FFB52DAE489A00703C75
/* YHVisitHKAlertView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHVisitHKAlertView.swift
;
sourceTree
=
"<group>"
;
};
04D8FFB72DB0D50B00703C75
/* YHGalaxyNewsListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGalaxyNewsListViewController.swift
;
sourceTree
=
"<group>"
;
};
04D8FFB72DB0D50B00703C75
/* YHGalaxyNewsListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGalaxyNewsListViewController.swift
;
sourceTree
=
"<group>"
;
};
04D8FFB92DB0D95A00703C75
/* YHGalaxyNewsCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGalaxyNewsCell.swift
;
sourceTree
=
"<group>"
;
};
04D8FFB92DB0D95A00703C75
/* YHGalaxyNewsCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHGalaxyNewsCell.swift
;
sourceTree
=
"<group>"
;
};
04DFB6EF2E8BA8D1008EC0EB
/* YHTagFlowLayout.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTagFlowLayout.swift
;
sourceTree
=
"<group>"
;
};
04DFB6F12E8BAA1C008EC0EB
/* YHTagCollectionView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTagCollectionView.swift
;
sourceTree
=
"<group>"
;
};
04E0D3C72E866A6300F1824B
/* YHCirclePhotoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCirclePhotoCell.swift
;
sourceTree
=
"<group>"
;
};
04E0D3C72E866A6300F1824B
/* YHCirclePhotoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCirclePhotoCell.swift
;
sourceTree
=
"<group>"
;
};
04E0D3C92E866A9800F1824B
/* YHCircleAddPhotoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleAddPhotoCell.swift
;
sourceTree
=
"<group>"
;
};
04E0D3C92E866A9800F1824B
/* YHCircleAddPhotoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCircleAddPhotoCell.swift
;
sourceTree
=
"<group>"
;
};
04E0D3CB2E877D4D00F1824B
/* YHMediaUploadSheetView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMediaUploadSheetView.swift
;
sourceTree
=
"<group>"
;
};
04E0D3CB2E877D4D00F1824B
/* YHMediaUploadSheetView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMediaUploadSheetView.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -3294,6 +3298,7 @@
...
@@ -3294,6 +3298,7 @@
045C0A952D12CA5E00BD2DC0
/* YHMyFriendsNoDataView.swift */
,
045C0A952D12CA5E00BD2DC0
/* YHMyFriendsNoDataView.swift */
,
045C0A962D12CA5E00BD2DC0
/* YHMyInformationItemCell.swift */
,
045C0A962D12CA5E00BD2DC0
/* YHMyInformationItemCell.swift */
,
045C0A972D12CA5E00BD2DC0
/* YHMyInterestTopicCell.swift */
,
045C0A972D12CA5E00BD2DC0
/* YHMyInterestTopicCell.swift */
,
04DFB6EF2E8BA8D1008EC0EB
/* YHTagFlowLayout.swift */
,
045C0A982D12CA5E00BD2DC0
/* YHMyIntroductionCell.swift */
,
045C0A982D12CA5E00BD2DC0
/* YHMyIntroductionCell.swift */
,
045C0A992D12CA5E00BD2DC0
/* YHMyNameCardAvatarInfoCell.swift */
,
045C0A992D12CA5E00BD2DC0
/* YHMyNameCardAvatarInfoCell.swift */
,
045C0A9A2D12CA5E00BD2DC0
/* YHMyWorkExperienceCell.swift */
,
045C0A9A2D12CA5E00BD2DC0
/* YHMyWorkExperienceCell.swift */
,
...
@@ -3301,6 +3306,7 @@
...
@@ -3301,6 +3306,7 @@
045C0A9C2D12CA5E00BD2DC0
/* YHPeopleMatchNoDataView.swift */
,
045C0A9C2D12CA5E00BD2DC0
/* YHPeopleMatchNoDataView.swift */
,
045C0A9D2D12CA5E00BD2DC0
/* YHPeopleSuccessView.swift */
,
045C0A9D2D12CA5E00BD2DC0
/* YHPeopleSuccessView.swift */
,
045C0A9E2D12CA5E00BD2DC0
/* YHSetExplainView.swift */
,
045C0A9E2D12CA5E00BD2DC0
/* YHSetExplainView.swift */
,
04DFB6F12E8BAA1C008EC0EB
/* YHTagCollectionView.swift */
,
);
);
path
=
V
;
path
=
V
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -8484,6 +8490,7 @@
...
@@ -8484,6 +8490,7 @@
045C12862D12CA5F00BD2DC0
/* YHOfficialApprovalResultVC.swift in Sources */
,
045C12862D12CA5F00BD2DC0
/* YHOfficialApprovalResultVC.swift in Sources */
,
045C12872D12CA5F00BD2DC0
/* YHStatusAdvantageVC.swift in Sources */
,
045C12872D12CA5F00BD2DC0
/* YHStatusAdvantageVC.swift in Sources */
,
045C12882D12CA5F00BD2DC0
/* YHHKPlanDoctumentVC.swift in Sources */
,
045C12882D12CA5F00BD2DC0
/* YHHKPlanDoctumentVC.swift in Sources */
,
04DFB6F02E8BA8D1008EC0EB
/* YHTagFlowLayout.swift in Sources */
,
045C12892D12CA5F00BD2DC0
/* YHHomeHeadView.swift in Sources */
,
045C12892D12CA5F00BD2DC0
/* YHHomeHeadView.swift in Sources */
,
04D8FF752D978CF000703C75
/* YHPlanLinkShareView.swift in Sources */
,
04D8FF752D978CF000703C75
/* YHPlanLinkShareView.swift in Sources */
,
0411CF062D1A88EA00644D35
/* YHGCDocListCell.swift in Sources */
,
0411CF062D1A88EA00644D35
/* YHGCDocListCell.swift in Sources */
,
...
@@ -8790,6 +8797,7 @@
...
@@ -8790,6 +8797,7 @@
045C138B2D12CA5F00BD2DC0
/* YHResignUploadTravelGuideView.swift in Sources */
,
045C138B2D12CA5F00BD2DC0
/* YHResignUploadTravelGuideView.swift in Sources */
,
045C138C2D12CA5F00BD2DC0
/* YHResignFamilyMemberInfoCell.swift in Sources */
,
045C138C2D12CA5F00BD2DC0
/* YHResignFamilyMemberInfoCell.swift in Sources */
,
04307B7F2D1AB31000ED8E8D
/* YHGCPreviewMainViewController.swift in Sources */
,
04307B7F2D1AB31000ED8E8D
/* YHGCPreviewMainViewController.swift in Sources */
,
04DFB6F22E8BAA1C008EC0EB
/* YHTagCollectionView.swift in Sources */
,
045C138D2D12CA5F00BD2DC0
/* YHDocumentUploadView.swift in Sources */
,
045C138D2D12CA5F00BD2DC0
/* YHDocumentUploadView.swift in Sources */
,
045C138E2D12CA5F00BD2DC0
/* YHOtherSelecteItemView.swift in Sources */
,
045C138E2D12CA5F00BD2DC0
/* YHOtherSelecteItemView.swift in Sources */
,
045C138F2D12CA5F00BD2DC0
/* YHHKRecordsSummaryVC.swift in Sources */
,
045C138F2D12CA5F00BD2DC0
/* YHHKRecordsSummaryVC.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHInterestTopicLayout.swift
View file @
ecc5dafd
...
@@ -20,35 +20,22 @@ class YHInterestTopicLayout: UICollectionViewFlowLayout {
...
@@ -20,35 +20,22 @@ class YHInterestTopicLayout: UICollectionViewFlowLayout {
}
}
override
func
layoutAttributesForElements
(
in
rect
:
CGRect
)
->
[
UICollectionViewLayoutAttributes
]?
{
override
func
layoutAttributesForElements
(
in
rect
:
CGRect
)
->
[
UICollectionViewLayoutAttributes
]?
{
let
arrCell
=
super
.
layoutAttributesForElements
(
in
:
rect
)
guard
let
attributes
=
super
.
layoutAttributesForElements
(
in
:
rect
)
else
{
return
nil
}
if
arrCell
==
nil
{
return
nil
}
if
arrCell
!.
count
<=
1
{
return
arrCell
}
var
leftMargin
=
sectionInset
.
left
for
i
in
1
..<
arrCell
!.
count
{
var
maxY
:
CGFloat
=
-
1.0
// 当前 UICollectionViewLayoutAttributes
let
currentLayout
=
arrCell
!
[
i
]
attributes
.
forEach
{
layoutAttribute
in
// 上一个 UICollectionViewLayoutAttributes
if
layoutAttribute
.
frame
.
origin
.
y
>=
maxY
{
let
prevLayout
=
arrCell
!
[
i
-
1
]
leftMargin
=
sectionInset
.
left
if
prevLayout
.
indexPath
.
section
==
currentLayout
.
indexPath
.
section
{
// 我们想设置的最大间距,可根据需要改
let
maximumSpacing
=
self
.
minimumInteritemSpacing
// 前一个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
.
collectionViewWidth
{
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
}
}
}
layoutAttribute
.
frame
.
origin
.
x
=
leftMargin
leftMargin
+=
layoutAttribute
.
frame
.
width
+
minimumInteritemSpacing
maxY
=
max
(
layoutAttribute
.
frame
.
maxY
,
maxY
)
}
}
return
arrCell
return
attributes
}
}
override
var
collectionViewContentSize
:
CGSize
{
override
var
collectionViewContentSize
:
CGSize
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHMyInterestTopicCell.swift
View file @
ecc5dafd
...
@@ -143,8 +143,8 @@ class YHMyInterestTopicCell: UITableViewCell {
...
@@ -143,8 +143,8 @@ class YHMyInterestTopicCell: UITableViewCell {
return
layout
return
layout
}()
}()
lazy
var
collectionView
:
UI
CollectionView
=
{
lazy
var
collectionView
:
YHTag
CollectionView
=
{
let
collectView
=
UI
CollectionView
(
frame
:
.
zero
,
collectionViewLayout
:
self
.
layout
)
let
collectView
=
YHTag
CollectionView
(
frame
:
.
zero
,
collectionViewLayout
:
self
.
layout
)
collectView
.
delegate
=
self
collectView
.
delegate
=
self
collectView
.
dataSource
=
self
collectView
.
dataSource
=
self
collectView
.
backgroundColor
=
.
white
collectView
.
backgroundColor
=
.
white
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHTagCollectionView.swift
0 → 100644
View file @
ecc5dafd
//
// YHTagCollectionView.swift
// galaxy
//
// Created by Dufet on 2025/9/30.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
// MARK: - 自适应高度的CollectionView
class
YHTagCollectionView
:
UICollectionView
{
override
var
contentSize
:
CGSize
{
didSet
{
invalidateIntrinsicContentSize
()
}
}
override
var
intrinsicContentSize
:
CGSize
{
layoutIfNeeded
()
return
CGSize
(
width
:
UIView
.
noIntrinsicMetric
,
height
:
contentSize
.
height
)
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHTagFlowLayout.swift
0 → 100644
View file @
ecc5dafd
//
// YHTagFlowLayout.swift
// galaxy
//
// Created by Dufet on 2025/9/30.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHTagFlowLayout
:
NSObject
{
}
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