Hi, I have a UIView onscreen that was created in a storyboard. At some point in the code (after viewDidLoad), the view's layer.cornerRadius is changed to give it rounded corners. However, the view keeps its square corners until the user taps a button and the contents of the screen are slightly changed. At this point, the view is redrawn with rounded corners.
What needs to be done to have the UI update itself immediately? myView.setNeedsDisplay had no effect. I know I could put this in viewDidLoad, but I'm trying to understand why things aren't updating as expected.
Thanks!
What needs to be done to have the UI update itself immediately? myView.setNeedsDisplay had no effect. I know I could put this in viewDidLoad, but I'm trying to understand why things aren't updating as expected.
Thanks!
Code:
myView.layer.cornerRadius = myView.bounds.height / 2.0
myView.setNeedsDisplay()