i tried to change the width of my Image view to 20
@IBOutlet weak var image: UIImageView!
using this code in viewDidLoad self.image.frame.width = 20
get-only means you can only read this property (for example to compare with something), but not change. To set width you need this:
self.image.frame.size.width = foo
There is 2 ways to solve this:
self.image.frame.size.width = some value
You can add width constraint to your view (by code, storyboard or xib) and set this constraint's constant property to some value
Swift:
let widthValue = self.view.frame.size.width
self.btnName.frame.size.width = widthValue
self.txtEMail.frame.size.width = (widthValue - 32)
self.lblUserName.frame.size.width = (widthValue * 2)