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
16109834
Commit
16109834
authored
Apr 14, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页 置顶
parent
f05205a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+4
-1
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+27
-0
YHStartPageViewController.swift
...lasses/Modules/Home(首页)/C/YHStartPageViewController.swift
+3
-1
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
16109834
...
@@ -124,7 +124,10 @@ extension AppDelegate {
...
@@ -124,7 +124,10 @@ extension AppDelegate {
//1.设置主窗口
//1.设置主窗口
private
func
setupRootVC
()
{
private
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
tabBarController
=
YHTabBarViewController
()
let
v0
=
YHNavigationController
(
rootVC
:
YHHomePageViewController
())
let
homeVC
=
YHHomePageViewController
()
tabBarController
.
delegate
=
homeVC
let
v0
=
YHNavigationController
(
rootVC
:
homeVC
)
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
16109834
...
@@ -54,6 +54,10 @@ class YHHomePageViewController: YHBaseViewController {
...
@@ -54,6 +54,10 @@ class YHHomePageViewController: YHBaseViewController {
let
view
=
YHHomeHeadView
()
let
view
=
YHHomeHeadView
()
return
view
return
view
}()
}()
var
tapTimestamp
:
CFAbsoluteTime
=
-
10.0
}
}
private
extension
YHHomePageViewController
{
private
extension
YHHomePageViewController
{
...
@@ -96,6 +100,11 @@ private extension YHHomePageViewController {
...
@@ -96,6 +100,11 @@ private extension YHHomePageViewController {
}
}
self
.
homeCollectView
.
reloadData
()
self
.
homeCollectView
.
reloadData
()
// DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute:{
// printLog(YHHomeHeadView.viewH)
// printLog(self.homeCollectView.contentOffset)
// })
}
}
}
}
...
@@ -184,3 +193,21 @@ extension YHHomePageViewController : CollectionViewWaterfallLayoutDelegate {
...
@@ -184,3 +193,21 @@ extension YHHomePageViewController : CollectionViewWaterfallLayoutDelegate {
return
CGSize
(
width
:
model
.
img_width_cell
,
height
:
model
.
img_height_cell
)
return
CGSize
(
width
:
model
.
img_width_cell
,
height
:
model
.
img_height_cell
)
}
}
}
}
extension
YHHomePageViewController
:
UITabBarControllerDelegate
{
func
tabBarController
(
_
tabBarController
:
UITabBarController
,
didSelect
viewController
:
UIViewController
)
{
let
doubleTapInterval
:
CGFloat
=
0.3
if
tabBarController
.
selectedIndex
==
0
{
let
timestamp
=
CFAbsoluteTimeGetCurrent
()
printLog
(
timestamp
-
self
.
tapTimestamp
)
if
timestamp
-
self
.
tapTimestamp
<
doubleTapInterval
{
UIView
.
animate
(
withDuration
:
0.25
)
{
self
.
homeCollectView
.
contentOffset
=
CGPoint
(
x
:
0
,
y
:
-
YHHomeHeadView
.
viewH
)
//置顶功能
}
}
self
.
tapTimestamp
=
timestamp
}
}
}
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHStartPageViewController.swift
View file @
16109834
...
@@ -98,7 +98,9 @@ private extension YHStartPageViewController {
...
@@ -98,7 +98,9 @@ private extension YHStartPageViewController {
//1.设置主窗口
//1.设置主窗口
func
setupRootVC
()
{
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
tabBarController
=
YHTabBarViewController
()
let
v0
=
YHNavigationController
(
rootVC
:
YHHomePageViewController
())
let
homeVC
=
YHHomePageViewController
()
tabBarController
.
delegate
=
homeVC
let
v0
=
YHNavigationController
(
rootVC
:
homeVC
)
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
...
...
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