Programmatically change the height and width of a UIImageView Xcode Swift
The accepted answer in Swift 3:
let screenSize: CGRect = UIScreen.main.bounds
image.frame = CGRect(x: 0, y: 0, width: 50, height: screenSize.height * 0.2)
let screenSize: CGRect = UIScreen.mainScreen().bounds
image.frame = CGRectMake(0,0, screenSize.height * 0.2, 50)
Using autoview
image.heightAnchor.constraint(equalToConstant: CGFloat(8)).isActive = true