diff options
author | Nadia Barbosa <nadiabarbosa@me.com> | 2019-03-29 16:20:24 -0700 |
---|---|---|
committer | Nadia Barbosa <nadiabarbosa@me.com> | 2019-03-29 16:20:24 -0700 |
commit | ef65313d2d5767e891decd30f70f4adde403737e (patch) | |
tree | 5b8f58197e107e50a125ebc393f1acbb613c6b19 | |
parent | 8a688c1d2617ecfc2f8ea3e5fc6ce1eced35b48c (diff) | |
download | qtlocation-mapboxgl-upstream/nbsa-12.2-repro-with-work-around.tar.gz |
Fire timer after 5 secondsupstream/nbsa-12.2-repro-with-work-around
-rw-r--r-- | platform/ios/app/MBXTabBarViewController.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/platform/ios/app/MBXTabBarViewController.m b/platform/ios/app/MBXTabBarViewController.m index cfd3571a2b..f8173b9068 100644 --- a/platform/ios/app/MBXTabBarViewController.m +++ b/platform/ios/app/MBXTabBarViewController.m @@ -11,9 +11,11 @@ - (void)viewDidLoad { [super viewDidLoad]; - _repeatingTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) { - self.selectedIndex = self.selectedIndex == 1 ? 0 : 1; - }]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + self->_repeatingTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) { + self.selectedIndex = self.selectedIndex == 1 ? 0 : 1; + }]; + }); } @end |