Reputation: 901
Is there another way to clear a UILabel text
and a UIImageView image
without doing something like this?
label.text = @"";
image setImage:[UIImage imageNamed:@""];
Are there methods to execute these actions?
Upvotes: 2
Views: 1599
Reputation: 1572
The problem is old and already has a solution marked! but for Swift 3 I got it like this:
self.label.text = "00:00:01"
self.label.setNeedsLayout()
self.label.text = "00:00:02"
self.label.setNeedsLayout()
self.label.text = "00:00:03"
self.label.setNeedsLayout()
Upvotes: 0
Reputation: 11
I had a similar problem (used to put label.text =@"";
). This worked for me: label.text =nil;
Upvotes: 1
Reputation: 12405
these also work if you just want to play around..
label.text =nil;
image.image= nil;
what exactly do you wish to achieve....?
Upvotes: 1