From 61c6bd14a75a60f1a77c4735b9ebba418b7f1f17 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Thu, 1 Sep 2016 10:26:21 +0300 Subject: [PATCH] Update SSAccelerometerInfo.m Extension support added --- System Services/Utilities/SSAccelerometerInfo.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/System Services/Utilities/SSAccelerometerInfo.m b/System Services/Utilities/SSAccelerometerInfo.m index ef87be9..27c63bf 100755 --- a/System Services/Utilities/SSAccelerometerInfo.m +++ b/System Services/Utilities/SSAccelerometerInfo.m @@ -45,16 +45,18 @@ @implementation SSAccelerometerInfo + (UIInterfaceOrientation)deviceOrientation { // Get the device's current orientation @try { - // Device orientation - UIInterfaceOrientation Orientation = [[UIApplication sharedApplication] statusBarOrientation]; + #if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension)) + // Device orientation + UIInterfaceOrientation Orientation = [[UIApplication sharedApplication] statusBarOrientation]; - // Successful - return Orientation; + // Successful + return Orientation; + #end } @catch (NSException *exception) { - // Error - return -1; } + // Error + return -1; } // Start logging motion data