How to update UIViewController programmatically?

I have a ViewController in which the user selects a map (custom UIButton) from a UIScrollView. I intercepted a touch event, selected a map and identified it, and then deleted it from the data source, but it still exists in UISubView. How can I get rid of it? Updating the view should show that it has been removed from the view. How to do it?

+2
source share
4 answers

You can do this in one of two places:

  • in your view manager
  • directly in view

you need to call the setNeedsDisplay function

  • viewController, [yourViewOutletVariable/viewParameter setNeedsDisplay];
  • , [self setNeedsDisplay];

,

+2
0

:

UIView *v = ...;
[v removeFromSuperview];

setNeedsDisplay removeFromSuperview.

0

"UIViewController", :

[self viewDidLoad];
-1
source

All Articles