diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2016-07-17 14:27:02 -0700 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2016-07-17 14:27:02 -0700 |
commit | e7b94812725855e03f39fb39dc19972cb60d1c44 (patch) | |
tree | 36d72cce7068469407a37ae8e31e4ea6ff8564aa | |
parent | a4dc92e83cb73ff0b9e2408ccae5caa47ae8706c (diff) | |
download | sdl_ios-e7b94812725855e03f39fb39dc19972cb60d1c44.tar.gz |
Updated inits to avoid right shift.
-rw-r--r-- | SmartDeviceLink/SDLPinchGesture.m | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLTouch.m | 11 | ||||
-rw-r--r-- | SmartDeviceLink/SDLTouchManager.m | 14 |
3 files changed, 24 insertions, 14 deletions
diff --git a/SmartDeviceLink/SDLPinchGesture.m b/SmartDeviceLink/SDLPinchGesture.m index 15a65ce55..6d1bd959b 100644 --- a/SmartDeviceLink/SDLPinchGesture.m +++ b/SmartDeviceLink/SDLPinchGesture.m @@ -18,12 +18,15 @@ - (instancetype)initWithFirstTouch:(SDLTouch*)firstTouch secondTouch:(SDLTouch*)secondTouch { self = [super init]; - if (self) { - _firstTouch = firstTouch; - _secondTouch = secondTouch; - _distance = -1; - _center = CGPointZero; + if (!self) { + return nil; } + + _firstTouch = firstTouch; + _secondTouch = secondTouch; + _distance = -1; + _center = CGPointZero; + return self; } diff --git a/SmartDeviceLink/SDLTouch.m b/SmartDeviceLink/SDLTouch.m index dc8b27bf6..b4b198458 100644 --- a/SmartDeviceLink/SDLTouch.m +++ b/SmartDeviceLink/SDLTouch.m @@ -15,11 +15,14 @@ - (instancetype)init { self = [super init]; - if (self) { - _identifier = -1; - _location = CGPointZero; - _timeStamp = 0; + if (!self) { + return nil; } + + _identifier = -1; + _location = CGPointZero; + _timeStamp = 0; + return self; } diff --git a/SmartDeviceLink/SDLTouchManager.m b/SmartDeviceLink/SDLTouchManager.m index e86b6fff2..839a5433a 100644 --- a/SmartDeviceLink/SDLTouchManager.m +++ b/SmartDeviceLink/SDLTouchManager.m @@ -50,12 +50,16 @@ static NSUInteger const MaximumNumberOfTouches = 2; @implementation SDLTouchManager - (instancetype)init { - if (self = [super init]) { - _movementTimeThreshold = 0.5f; - _tapTimeThreshold = 0.4f; - _tapDistanceThreshold = 50.0f; - _touchEnabled = YES; + self = [super init]; + if (!self) { + return nil; } + + _movementTimeThreshold = 0.5f; + _tapTimeThreshold = 0.4f; + _tapDistanceThreshold = 50.0f; + _touchEnabled = YES; + return self; } |