Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Commit 9c5b2f6

Browse files
committed
[ios] Add an assert to test if the timer runs on the main thread.
1 parent 4dbe089 commit 9c5b2f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Examples/ObjectiveC/AnimatedLineExample.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ - (void)animatePolyline {
6363
}
6464

6565
- (void)tick:(NSTimer*)timer {
66+
NSAssert([[NSThread currentThread] isMainThread], @"%s must be accessed on the main thread, not %@", __PRETTY_FUNCTION__, [NSThread currentThread]);
6667
if (self.currentIndex > self.locations.count) {
6768
[self.timer invalidate];
6869
return;

0 commit comments

Comments
 (0)