user2262304
user2262304

Reputation: 349

How to update UIView in swift

I have a UISwitch in a view. I have a anther thread to detect a value A. I want to update view to set UISwitch be true or false depend on value A which is true or false.

How can I update UIView to change UISwitch in real time? Thank you.

Upvotes: 0

Views: 330

Answers (1)

Igor B.
Igor B.

Reputation: 2229

Consider this:

dispatch_async(dispatch_get_main_queue()){
    self.switchControl.on = aValue
}

Upvotes: 2

Related Questions