I'm working on the Swift project now and stuck on how to change my UIView's width in code.
In my storyboard, I have gray-colored UIView.
I set its width, in the inspector, as
equals: 160
However, I don't want to give an exact number for my UI, so I made @IBOutlet to it and tried to set the value as 0.2 * parent view's width. But when I build I cannot see the width changes...
@IBOutlet weak var parentView: UIView!
@IBOutlet weak var grayArea: UIView!
override func viewDidLoad() {
super.viewDidLoad()
grayArea.frame.size.width = parentView.frame.size.height * 0.2
}
I searched similar questions on Stack Overflow but none of them worked for my code. Could anyone please point me what I'm doing wrong in here?

