From 9c5b2f6cc653a740801cdbbc1d4eb4c045f363e2 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Tue, 10 Sep 2019 16:34:35 -0700 Subject: [PATCH] [ios] Add an assert to test if the timer runs on the main thread. --- Examples/ObjectiveC/AnimatedLineExample.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/ObjectiveC/AnimatedLineExample.m b/Examples/ObjectiveC/AnimatedLineExample.m index 4694bef3..baceae9b 100644 --- a/Examples/ObjectiveC/AnimatedLineExample.m +++ b/Examples/ObjectiveC/AnimatedLineExample.m @@ -63,6 +63,7 @@ - (void)animatePolyline { } - (void)tick:(NSTimer*)timer { + NSAssert([[NSThread currentThread] isMainThread], @"%s must be accessed on the main thread, not %@", __PRETTY_FUNCTION__, [NSThread currentThread]); if (self.currentIndex > self.locations.count) { [self.timer invalidate]; return;