Reputation: 5103
I have a ViewController in which the user selects a card (a custom UIButton) out of a UIScrollView. I have intercepted the touch event selecting the card and identified it, and then removed it from the data source, but it still exists in the UISubView. How do I get rid of it? Refreshing the view should show it removed from the view. How do I do that?
Upvotes: 2
Views: 31712
Reputation: 3504
If your point is to refresh "UIViewController", then:
[self viewDidLoad];
Upvotes: -1
Reputation: 495
Once you have a handle on your view:
UIView *v = ...;
[v removeFromSuperview];
You could also call the setNeedsDisplay method on your scroll view after calling removeFromSuperview.
Upvotes: 0
Reputation: 3340
you can do it in one of two places:
you need to call the function setNeedsDisplay
[yourViewOutletVariable/viewParameter setNeedsDisplay];
[self setNeedsDisplay];
hope this helps
Upvotes: 2
Reputation: 144
You can either let view controller observe your models or update your views manually.
I'm not very clear about your question, what is still remaining on your view?
For automatically update views when model changes, I suggest ReactiveCocoa.
Upvotes: 0