I have a view that I will say in order to update its data. But sometimes the data changes when the view is not displayed. So, how can I detect that the viewcontroller is visible and receiving events? I could add a boolean that was changed in viewWillAppear and viewWillDisappear, but there seems to be a way to directly detect the state ...
Thanks Gary
Short answer: if you use the UINavigationController, you can use its visibleViewController so that you do not have to track a single boolean value.
: , , reloadData viewWillAppear, , . reloadData , . . , , , , , , . , ... , - ...
- :
[(UITableView *)[self view] reloadData];
viewControllerWillAppear. , , .
You can probably check the property of the viewport:
- (BOOL)isVisible { return view.window != NULL; }
But I think maintaining a variable is BOOLbetter.
BOOL
Source: https://habr.com/ru/post/1708141/More articles:Test environment for [enter language here] - unit-testingHow to return JsonResult in ASP.NET MVC - jsonWhat is the best way to back up an SVN server for all code and content? - svnudp client is not available from another application - javaSecondary label does not work - delphiVB.NET event handling in VB6 code - debuggingHow to prevent users from using one account? (ASP.NET MVC) - securityUpper (reasonable) limit on the number of instances of user control - c #Как изменить размер (ширина + высота) панелей предварительного просмотра XML-макета в плагине ADT для Eclipse? - androidScreen sharing in Adobe Air - airAll Articles