Swift / UIView / drawrect - how to get drawrect to update when required
问题 I'm new to learning Swift, and am trying to get an incredibly simple app to run. All I'm trying to do is get UIView.drawRect to update when I press a button . It updates/draws when the app first loads, and then nothing after that, whatever I try. I've been hitting my head against this for a couple of days, and nothing I can find helps. I created: single view application one button, linked to view controller as an action a new class, Test_View, subclassing UIView ViewController code: class