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
ef7c571d
Commit
ef7c571d
authored
Dec 27, 2023
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消除几处警告
parent
9f3f62da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
97 deletions
+3
-97
AlignedCollectionViewFlowLayout.swift
...ses/Tools/Extention/AlignedCollectionViewFlowLayout.swift
+3
-0
UIView-Extension.swift
galaxy/galaxy/Classes/Tools/Extention/UIView-Extension.swift
+0
-97
No files found.
galaxy/galaxy/Classes/Tools/Extention/AlignedCollectionViewFlowLayout.swift
View file @
ef7c571d
...
...
@@ -124,6 +124,9 @@ open class AlignedCollectionViewFlowLayout: UICollectionViewFlowLayout {
default
:
break
}
@unknown
default
:
print
(
"123"
)
break
}
// It's safe to force-unwrap as `.leading` and `.trailing` are covered
...
...
galaxy/galaxy/Classes/Tools/Extention/UIView-Extension.swift
View file @
ef7c571d
...
...
@@ -36,27 +36,6 @@ extension UIView {
}
return
nil
}
// MARK: - UIView 晃动效果
public
func
shake2
(
direction
:
ShakeDirection
=
.
horizontal
,
times
:
Int
=
5
,
interval
:
TimeInterval
=
0.1
,
delta
:
CGFloat
=
5
,
completion
:(()
->
Void
)?
=
nil
){
if
times
==
0
{
self
.
layer
.
setAffineTransform
(
CGAffineTransform
.
identity
)
}
else
{
UIView
.
animate
(
withDuration
:
interval
)
{
switch
direction
{
case
.
horizontal
:
self
.
layer
.
setAffineTransform
(
CGAffineTransform
(
translationX
:
delta
,
y
:
0
))
break
case
.
vertical
:
self
.
layer
.
setAffineTransform
(
CGAffineTransform
(
translationX
:
0
,
y
:
delta
))
break
}
}
completion
:
{
(
finished
)
in
self
.
shake2
(
direction
:
direction
,
times
:
times
-
1
,
interval
:
interval
,
delta
:
delta
*
-
1
,
completion
:
completion
)
}
}
}
}
...
...
@@ -206,79 +185,3 @@ extension UIView {
}
// MARK: - Frame
extension
UIView
{
//let cOrigin: CGPoint //!< 位置
//let cSize: CGSize //!< 大小
public
var
height
:
CGFloat
{
get
{
return
self
.
frame
.
height
}
set
{
var
frame
=
self
.
frame
frame
.
size
.
height
=
newValue
self
.
frame
=
frame
}
}
//!< 高度
public
var
width
:
CGFloat
{
get
{
return
self
.
frame
.
width
}
set
{
var
frame
=
self
.
frame
frame
.
size
.
width
=
newValue
self
.
frame
=
frame
}
}
//!< 宽度
public
var
top
:
CGFloat
{
get
{
return
self
.
frame
.
minY
}
set
{
var
frame
=
self
.
frame
frame
.
origin
.
y
=
newValue
self
.
frame
=
frame
}
}
//!< 上
public
var
left
:
CGFloat
{
get
{
return
self
.
frame
.
minX
}
set
{
var
frame
=
self
.
frame
frame
.
origin
.
x
=
newValue
self
.
frame
=
frame
}
}
//!< 左
public
var
bottom
:
CGFloat
{
get
{
return
self
.
frame
.
maxY
}
set
{
var
frame
=
self
.
frame
frame
.
origin
.
y
=
newValue
-
self
.
frame
.
height
self
.
frame
=
frame
}
}
//!< 下
public
var
right
:
CGFloat
{
get
{
return
self
.
frame
.
maxX
}
set
{
var
frame
=
self
.
frame
;
frame
.
origin
.
x
=
newValue
-
self
.
frame
.
width
self
.
frame
=
frame
}
}
//!< 右
}
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