diff options
author | NicoleYarroch <nicole@livio.io> | 2018-03-02 16:32:11 -0500 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2018-03-02 16:32:11 -0500 |
commit | e49ab8af53741cb266ed3dd643a4f72393bbaafc (patch) | |
tree | 9f190abc8b165f5adf951e90e37b491d394ba4ca | |
parent | 1d2a882798eead75007b78fb32b12a0b58e21762 (diff) | |
download | sdl_ios-bugfix/issue_876_broken_test_cases.tar.gz |
Fixed touch manager test casesbugfix/issue_876_broken_test_cases
-rw-r--r-- | SmartDeviceLink/SDLTouchManager.m | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/SmartDeviceLink/SDLTouchManager.m b/SmartDeviceLink/SDLTouchManager.m index dc9adf5bd..eb314c321 100644 --- a/SmartDeviceLink/SDLTouchManager.m +++ b/SmartDeviceLink/SDLTouchManager.m @@ -120,11 +120,11 @@ static NSUInteger const MaximumNumberOfTouches = 2; } - (void)syncFrame { - dispatch_async(dispatch_get_main_queue(), ^{ - if (!self.isTouchEnabled || (!self.touchEventHandler && !self.touchEventDelegate)) { - return; - } + if (!self.isTouchEnabled || (!self.touchEventHandler && !self.touchEventDelegate)) { + return; + } + dispatch_async(dispatch_get_main_queue(), ^{ if (self.performingTouchType == SDLPerformingTouchTypePanningTouch) { CGPoint storedTouchLocation = self.lastStoredTouchLocation; CGPoint notifiedTouchLocation = self.lastNotifiedTouchLocation; @@ -155,7 +155,6 @@ static NSUInteger const MaximumNumberOfTouches = 2; } self.previousPinchDistance = self.currentPinchGesture.distance; - } }); } @@ -168,27 +167,27 @@ static NSUInteger const MaximumNumberOfTouches = 2; * @param notification A SDLOnTouchEvent notification. */ - (void)sdl_onTouchEvent:(SDLRPCNotificationNotification *)notification { - dispatch_async(dispatch_get_main_queue(), ^{ - if (!self.isTouchEnabled - || (!self.touchEventHandler && !self.touchEventDelegate) - || ![notification.notification isKindOfClass:SDLOnTouchEvent.class]) { - return; - } + if (!self.isTouchEnabled + || (!self.touchEventHandler && !self.touchEventDelegate) + || ![notification.notification isKindOfClass:SDLOnTouchEvent.class]) { + return; + } - SDLOnTouchEvent* onTouchEvent = (SDLOnTouchEvent*)notification.notification; + SDLOnTouchEvent* onTouchEvent = (SDLOnTouchEvent*)notification.notification; - SDLTouchType touchType = onTouchEvent.type; - SDLTouchEvent *touchEvent = onTouchEvent.event.firstObject; - SDLTouch *touch = [[SDLTouch alloc] initWithTouchEvent:touchEvent]; + SDLTouchType touchType = onTouchEvent.type; + SDLTouchEvent *touchEvent = onTouchEvent.event.firstObject; + SDLTouch *touch = [[SDLTouch alloc] initWithTouchEvent:touchEvent]; - if (self.touchEventHandler) { - self.touchEventHandler(touch, touchType); - } + if (self.touchEventHandler) { + self.touchEventHandler(touch, touchType); + } - if (!self.touchEventDelegate || (touch.identifier > MaximumNumberOfTouches)) { - return; - } + if (!self.touchEventDelegate || (touch.identifier > MaximumNumberOfTouches)) { + return; + } + dispatch_async(dispatch_get_main_queue(), ^{ if ([onTouchEvent.type isEqualToEnum:SDLTouchTypeBegin]) { [self sdl_handleTouchBegan:touch]; } else if ([onTouchEvent.type isEqualToEnum:SDLTouchTypeMove]) { |