CGRect
public extension CGRect
extension CGRect: ScopeFunctions
-
Returns a new rect that is the result of centering the receiver in
rect
.Declaration
Swift
func center(inRect rect: CGRect) -> CGRect
Parameters
rect
The rect to center the receiver in
Return Value
The centered rect
-
Returns a new rect that is the result of centering the receiver horizontally in
rect
.Declaration
Swift
func centerHorizontally(inRect rect: CGRect) -> CGRect
Parameters
rect
The rect to horizontally center the receiver in
Return Value
The horizontally centered rect
-
Returns a new rect that is the result of centering the receiver vertically in
rect
.Declaration
Swift
func centerVertically(inRect rect: CGRect) -> CGRect
Parameters
rect
The rect to vertically center the receiver in
Return Value
The vertically centered rect