Commit 7f7f160b by Orkhan Alikhanov

Moved size method to a related extension

parent dd38b17d
......@@ -390,17 +390,7 @@ public extension Layout {
func height(offset: CGFloat = 0) -> Layout {
return constraint(.height, constant: offset)
}
/**
The width and height of the view to its parent's.
- Parameter _ size: A CGSize offset.
- Returns: A Layout instance to allow chaining.
*/
@discardableResult
func size(_ size: CGSize) -> Layout {
return width(size.width).height(size.height)
}
/**
Constraints edges of the view to its parent's.
- Parameter top: A CGFloat offset for top.
......@@ -435,6 +425,16 @@ public extension Layout {
func height(_ height: CGFloat) -> Layout {
return constraint(.constantHeight, constants: height)
}
/**
The width and height of the view to its parent's.
- Parameter _ size: A CGSize offset.
- Returns: A Layout instance to allow chaining.
*/
@discardableResult
func size(_ size: CGSize) -> Layout {
return width(size.width).height(size.height)
}
}
public extension Layout {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment