File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Sources/DeclarativeLayoutKit/AutoLayout Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11Pod ::Spec . new do |spec |
22
33 spec . name = "DeclarativeLayoutKit"
4- spec . version = "3.0.2 "
4+ spec . version = "3.0.3 "
55 spec . summary = "UIKit declarative layout like SwiftUI."
66 spec . homepage = "https://github.com/Ernest0-Production/DeclarativeLayoutKit"
77 spec . license = { :type => "MIT" , :file => "LICENSE.md" }
Original file line number Diff line number Diff line change @@ -64,6 +64,17 @@ public extension AutoLayoutItemConvertible {
6464 } )
6565 }
6666
67+ func leadingAnchor( _ anchor: HorizontalRelativeAutoLayoutAnchorConvertible ) -> AutoLayoutItem {
68+ asAutoLayoutItem ( ) . layout ( { view in
69+ makeRelativeConstraint (
70+ view: view,
71+ anchorProvider: { $0. leadingAnchor } ,
72+ second: anchor. asHorizontalRelativeAutoLayoutAnchor ( ) ,
73+ invertConstant: false
74+ )
75+ } )
76+ }
77+
6778 func rightAnchor( _ anchor: HorizontalRelativeAutoLayoutAnchorConvertible ) -> AutoLayoutItem {
6879 asAutoLayoutItem ( ) . layout ( { view in
6980 makeRelativeConstraint (
@@ -75,6 +86,17 @@ public extension AutoLayoutItemConvertible {
7586 } )
7687 }
7788
89+ func trailingAnchor( _ anchor: HorizontalRelativeAutoLayoutAnchorConvertible ) -> AutoLayoutItem {
90+ asAutoLayoutItem ( ) . layout ( { view in
91+ makeRelativeConstraint (
92+ view: view,
93+ anchorProvider: { $0. trailingAnchor } ,
94+ second: anchor. asHorizontalRelativeAutoLayoutAnchor ( ) ,
95+ invertConstant: false
96+ )
97+ } )
98+ }
99+
78100 func centerXAnchor( _ anchor: HorizontalRelativeAutoLayoutAnchorConvertible = 0 ) -> AutoLayoutItem {
79101 asAutoLayoutItem ( ) . layout ( { view in
80102 makeRelativeConstraint (
You can’t perform that action at this time.
0 commit comments