Created
August 4, 2020 07:40
-
-
Save bugrym/50908a617aa84d7fa160bc4600420eac to your computer and use it in GitHub Desktop.
Extension for UIView with all parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIView { | |
public var width:CGFloat { | |
return self.frame.size.width | |
} | |
public var height:CGFloat { | |
return self.frame.size.height | |
} | |
public var top:CGFloat { | |
return self.frame.origin.y | |
} | |
public var bottom:CGFloat { | |
return self.frame.size.height + self.frame.origin.y | |
} | |
public var left:CGFloat { | |
return self.frame.origin.x | |
} | |
public var right:CGFloat { | |
return self.frame.size.width + self.frame.origin.x | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment