From 6d75c0209d889af36948212dc1bc5f4efd78914f Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 6 Feb 2014 17:06:02 -0500 Subject: [PATCH] only output FPS on iOS when in debug mode --- ios/MBXViewController.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/MBXViewController.mm b/ios/MBXViewController.mm index a35ae5f5a..580f36853 100644 --- a/ios/MBXViewController.mm +++ b/ios/MBXViewController.mm @@ -22,6 +22,7 @@ @property (nonatomic) CGPoint center; @property (nonatomic) CGFloat scale; @property (nonatomic) CGFloat angle; +@property (nonatomic) BOOL debug; @end @@ -127,7 +128,9 @@ class MBXMapView if (current - elapsed >= 1) { - NSLog(@"FPS: %f", frames / (current - elapsed)); + if (self.debug) + NSLog(@"FPS: %f", frames / (current - elapsed)); + elapsed = current; frames = 0; } @@ -227,7 +230,11 @@ class MBXMapView - (void)handleThreeFingerLongPressGesture:(UILongPressGestureRecognizer *)threeFingerLongPress { if (threeFingerLongPress.state == UIGestureRecognizerStateBegan) + { mapView->map.toggleDebug(); + + self.debug = ! self.debug; + } } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer