Hi create this extends if you want. Update 2021 Swift 5
Create File Extends.Swift and add this code (add import foundation where you want change height)
extension UIView {
/**
Get Set x Position
- parameter x: CGFloat
*/
var x:CGFloat {
get {
return self.frame.origin.x
}
set {
self.frame.origin.x = newValue
}
}
/**
Get Set y Position
- parameter y: CGFloat
*/
var y:CGFloat {
get {
return self.frame.origin.y
}
set {
self.frame.origin.y = newValue
}
}
/**
Get Set Height
- parameter height: CGFloat
*/
var height:CGFloat {
get {
return self.frame.size.height
}
set {
self.frame.size.height = newValue
}
}
/**
Get Set Width
- parameter width: CGFloat
*/
var width:CGFloat {
get {
return self.frame.size.width
}
set {
self.frame.size.width = newValue
}
}
}
For Use (inherits Of UIView)
inheritsOfUIView.height = 100
button.height = 100
print(view.height)