Skip to content

Commit 499d437

Browse files
author
coderchan
committed
2.0.0-beta.2
1 parent 7ea654a commit 499d437

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

SwiftlyUI/Source/Core/UIView+SwiftlyUI.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ public extension UIView {
837837
}
838838
constraintTypes = []
839839
if types.contains(.top) {
840-
top(to: yAnchor, offset: offset)
840+
topTo(yAnchor, offset: offset)
841841
}
842842

843843
if types.contains(.bottom) {
@@ -1319,12 +1319,6 @@ public extension UIView {
13191319
constraintHolder = holder
13201320
return self
13211321
}
1322-
/// SwiftlyUI extension for `UIView`. Set Layout
1323-
/// 这是旧接口,请使用 topTo()方法代替
1324-
@discardableResult
1325-
func top(to anchor: NSLayoutYAxisAnchor, offset: CGFloat = 0) -> Self {
1326-
topTo(anchor, offset: offset)
1327-
}
13281322

13291323
/// SwiftlyUI extension for `UIView`. Set Layout
13301324
@discardableResult
@@ -1339,7 +1333,7 @@ public extension UIView {
13391333
type: .top
13401334
)
13411335
}else {
1342-
top(to: isMargins ? view.layoutMarginsGuide.topAnchor : view.topAnchor, offset: offset)
1336+
topTo(isMargins ? view.layoutMarginsGuide.topAnchor : view.topAnchor, offset: offset)
13431337
}
13441338
return self
13451339
}
@@ -2400,6 +2394,14 @@ public extension UIView {
24002394
topTo(view, isMargins: isMargins, offset: offset)
24012395
}
24022396

2397+
/// SwiftlyUI extension for `UIView`. Set Layout
2398+
/// 这是旧接口,请使用 topTo()方法代替
2399+
@available(*, deprecated, message: "SwiftlyUI - Use topTo() method instead.")
2400+
@discardableResult
2401+
func top(to anchor: NSLayoutYAxisAnchor, offset: CGFloat = 0) -> Self {
2402+
topTo(anchor, offset: offset)
2403+
}
2404+
24032405
/// SwiftlyUI extension for `UIView`. Set Layout
24042406
@discardableResult
24052407
@available(*, deprecated, message: "SwiftlyUI - Use topGreaterThanOrEqualTo instead.")

0 commit comments

Comments
 (0)