Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. @protocol MyBackgroundTaskDelegate
  2. @required
  3. - (void) progress: (float) value; // 0.0…1.0
  4. @optional
  5. - (void) workingOn: (NSString*) msg; // @"Doing this, doing that…"
  6. @end
  7.  
  8. // Starting our background task...
  9. [MyTask startComputationWithProgressHandler: ^(float progress, NSString* msg)
  10. {
  11. // Switching to the main thread because all UI stuff should go there...
  12. dispatch_async(dispatch_get_main_queue(), ^()
  13. {
  14. self.progressIndicator.progress = progress;
  15. self.informationalMessage = msg;
  16. });
  17. }];
  18.  
  19. @property(readonly, atomic) float progress;
  20. @property(readonly, atomic) NSString* message;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement