Skip to content

Commit

Permalink
refactor(ios): drop xcode 8 support (#11343)
Browse files Browse the repository at this point in the history
BREAKING CHANGES: Drops support for Xcode 8. Please use Xcode 9+

Fixes TIMOB-27497
  • Loading branch information
vijaysingh-axway authored and sgtcoolguy committed Dec 9, 2019
1 parent aedd2aa commit d5ede39
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 66 deletions.
7 changes: 1 addition & 6 deletions iphone/Classes/GeolocationModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,10 @@ - (CLLocationManager *)locationManager

locationManager.allowsBackgroundLocationUpdates = allowsBackgroundLocationUpdates;

#if IS_SDK_IOS_11
if ([TiUtils isIOSVersionOrGreater:@"11.0"]) {
locationManager.showsBackgroundLocationIndicator = showBackgroundLocationIndicator;
}
#endif

locationManager.activityType = activityType;
locationManager.pausesLocationUpdatesAutomatically = pauseLocationUpdateAutomatically;

Expand Down Expand Up @@ -605,23 +604,19 @@ - (void)setHeadingFilter:(CLLocationDegrees)value

- (BOOL)showBackgroundLocationIndicator
{
#if IS_SDK_IOS_11
if ([TiUtils isIOSVersionOrGreater:@"11.0"]) {
return showBackgroundLocationIndicator;
}
#endif
DebugLog(@"[ERROR] The showBackgroundLocationIndicator property is only available on iOS 11.0+. Returning \"false\" ...");
return NO;
}

- (void)setShowBackgroundLocationIndicator:(BOOL)value
{
#if IS_SDK_IOS_11
if ([TiUtils isIOSVersionOrGreater:@"11.0"]) {
showBackgroundLocationIndicator = value;
return;
}
#endif
DebugLog(@"[ERROR] The showBackgroundLocationIndicator property is only available on iOS 11.0+. Ignoring call ...");
}

Expand Down
33 changes: 17 additions & 16 deletions iphone/Classes/TiAppiOSUserNotificationCenterProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,24 @@ - (void)removePendingNotifications:(id)args
}
}];
} else {
TiThreadPerformOnMainThread(^{
if (args == nil || [args count] == 0) {
[[UIApplication sharedApplication] cancelAllLocalNotifications];
return;
}
TiThreadPerformOnMainThread(
^{
if (args == nil || [args count] == 0) {
[[UIApplication sharedApplication] cancelAllLocalNotifications];
return;
}

for (UILocalNotification *scheduledNotification in UIApplication.sharedApplication.scheduledLocalNotifications) {
for (id notification in args) {
ENSURE_TYPE(notification, NSDictionary);
for (UILocalNotification *scheduledNotification in UIApplication.sharedApplication.scheduledLocalNotifications) {
for (id notification in args) {
ENSURE_TYPE(notification, NSDictionary);

if ([notification[@"userInfo"][@"id"] isEqual:scheduledNotification.userInfo[@"id"]]) {
[UIApplication.sharedApplication cancelLocalNotification:scheduledNotification];
break;
if ([notification[@"userInfo"][@"id"] isEqual:scheduledNotification.userInfo[@"id"]]) {
[UIApplication.sharedApplication cancelLocalNotification:scheduledNotification];
break;
}
}
}
}
}
},
},
NO);
}
}
Expand Down Expand Up @@ -178,11 +179,11 @@ - (void)requestUserNotificationSettings:(id)callback
@"carPlaySetting" : @([settings carPlaySetting]),
@"alertStyle" : @([settings alertStyle])
} mutableCopy];
#if IS_SDK_IOS_11

if ([TiUtils isIOSVersionOrGreater:@"11.0"]) {
propertiesDict[@"showPreviewsSetting"] = @([settings showPreviewsSetting]);
}
#endif

#if IS_SDK_IOS_12
if ([TiUtils isIOSVersionOrGreater:@"12.0"]) {
propertiesDict[@"criticalAlertSetting"] = @([settings criticalAlertSetting]);
Expand Down
2 changes: 0 additions & 2 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2238,7 +2238,6 @@ - (void)viewResignFocus

- (void)viewGetFocus
{
#if IS_SDK_IOS_11
if (isSearchBarInNavigation) {
id proxy = [(TiViewProxy *)self.proxy parent];
while ([proxy isKindOfClass:[TiViewProxy class]] && ![proxy isKindOfClass:[TiWindowProxy class]]) {
Expand All @@ -2254,7 +2253,6 @@ - (void)viewGetFocus
controller.navigationItem.searchController = searchController;
}
}
#endif

if (isSearched && self.searchedString && ![searchController isActive]) {
isSearched = NO;
Expand Down
4 changes: 0 additions & 4 deletions iphone/Classes/TiUINavigationWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ - (void)navigationController:(UINavigationController *)navigationController will
}
}
TiWindowProxy *theWindow = (TiWindowProxy *)[(TiViewController *)viewController proxy];
#if IS_SDK_IOS_11
[theWindow processForSafeArea];
#endif
if ((theWindow != rootWindow) && [theWindow opening]) {
[theWindow windowWillOpen];
[theWindow windowDidOpen];
Expand Down Expand Up @@ -389,7 +387,6 @@ - (void)viewDidDisappear:(BOOL)animated
[super viewDidDisappear:animated];
}

#if IS_SDK_IOS_11
- (BOOL)homeIndicatorAutoHide
{
UIViewController *topVC = [navController topViewController];
Expand All @@ -401,7 +398,6 @@ - (BOOL)homeIndicatorAutoHide
}
return [super homeIndicatorAutoHide];
}
#endif

- (BOOL)hidesStatusBar
{
Expand Down
2 changes: 0 additions & 2 deletions iphone/Classes/TiUIScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ - (TiUIScrollViewImpl *)scrollView

- (void)adjustScrollViewInsets
{
#if IS_SDK_IOS_11
id viewProxy = self.proxy;
while (viewProxy && ![viewProxy isKindOfClass:[TiWindowProxy class]]) {
viewProxy = [viewProxy parent];
Expand All @@ -160,7 +159,6 @@ - (void)adjustScrollViewInsets
[scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}
}
#endif
}

- (id)accessibilityElement
Expand Down
2 changes: 0 additions & 2 deletions iphone/Classes/TiUITabGroupProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ - (UIStatusBarStyle)preferredStatusBarStyle;
return [super preferredStatusBarStyle];
}

#if IS_SDK_IOS_11
- (BOOL)homeIndicatorAutoHide
{
UITabBarController *tabController = [(TiUITabGroup *)[self view] tabController];
Expand All @@ -277,7 +276,6 @@ - (BOOL)homeIndicatorAutoHide
}
return [super homeIndicatorAutoHide];
}
#endif

- (BOOL)hidesStatusBar
{
Expand Down
9 changes: 3 additions & 6 deletions iphone/Classes/TiUITabProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,8 @@ - (void)openWindow:(NSArray *)args
TiWindowProxy *window = [args objectAtIndex:0];
ENSURE_TYPE(window, TiWindowProxy);

#if IS_SDK_IOS_11
[window processForSafeArea];
#endif

if (window == rootWindow) {
[rootWindow windowWillOpen];
[rootWindow windowDidOpen];
Expand Down Expand Up @@ -404,9 +403,8 @@ - (void)handleWillShowViewController:(UIViewController *)viewController animated
}
}
TiWindowProxy *theWindow = (TiWindowProxy *)[(TiViewController *)viewController proxy];
#if IS_SDK_IOS_11
[theWindow processForSafeArea];
#endif

if (theWindow == rootWindow) {
//This is probably too late for the root view controller.
//Figure out how to call open before this callback
Expand Down Expand Up @@ -766,7 +764,6 @@ - (void)popToRootWindow:(id)args

@synthesize parentOrientationController;

#if IS_SDK_IOS_11
- (BOOL)homeIndicatorAutoHide
{
if (rootWindow == nil) {
Expand All @@ -783,7 +780,7 @@ - (BOOL)homeIndicatorAutoHide
}
return NO;
}
#endif

- (BOOL)hidesStatusBar
{
if (rootWindow == nil) {
Expand Down
2 changes: 0 additions & 2 deletions iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,6 @@ - (void)viewResignFocus

- (void)viewGetFocus
{
#if IS_SDK_IOS_11
if (isSearchBarInNavigation) {
id proxy = [(TiViewProxy *)self.proxy parent];
while ([proxy isKindOfClass:[TiViewProxy class]] && ![proxy isKindOfClass:[TiWindowProxy class]]) {
Expand All @@ -2406,7 +2405,6 @@ - (void)viewGetFocus
controller.navigationItem.searchController = searchController;
}
}
#endif
if (!hideOnSearch && isSearched && self.searchedString && ![searchController isActive]) {
isSearched = NO;
searchController.searchBar.text = self.searchedString;
Expand Down
2 changes: 0 additions & 2 deletions iphone/Classes/TiUIWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@

@end

#if IS_SDK_IOS_11
@interface WebAppProtocolHandler : NSObject <WKURLSchemeHandler> {
}

+ (NSString *)specialProtocolScheme;

@end
#endif

#endif
4 changes: 0 additions & 4 deletions iphone/Classes/TiUIWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,11 @@ - (WKWebView *)webView

[config setUserContentController:controller];

#if IS_SDK_IOS_11
if ([TiUtils isIOSVersionOrGreater:@"11.0"]) {
if (![WKWebView handlesURLScheme:[WebAppProtocolHandler specialProtocolScheme]]) {
[config setURLSchemeHandler:[[WebAppProtocolHandler alloc] init] forURLScheme:[WebAppProtocolHandler specialProtocolScheme]];
}
}
#endif

_willHandleTouches = [TiUtils boolValue:[[self proxy] valueForKey:@"willHandleTouches"] def:YES];

Expand Down Expand Up @@ -1372,7 +1370,6 @@ - (NSHTTPCookie *)cookieForString:(NSString *)cookieStr

@end

#if IS_SDK_IOS_11
@implementation WebAppProtocolHandler

+ (NSString *)specialProtocolScheme
Expand Down Expand Up @@ -1423,6 +1420,5 @@ - (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURL
}

@end
#endif

#endif
2 changes: 0 additions & 2 deletions iphone/Classes/TiUIiOSProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,9 @@
@property (nonatomic, readonly) NSNumber *BLUR_EFFECT_STYLE_DARK;
#endif

#if IS_SDK_IOS_11
@property (nonatomic, readonly) NSNumber *LARGE_TITLE_DISPLAY_MODE_AUTOMATIC;
@property (nonatomic, readonly) NSNumber *LARGE_TITLE_DISPLAY_MODE_ALWAYS;
@property (nonatomic, readonly) NSNumber *LARGE_TITLE_DISPLAY_MODE_NEVER;
#endif

/**
Checks the force touch capibility of the current device.
Expand Down
4 changes: 0 additions & 4 deletions iphone/Classes/TiUIiOSProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -822,11 +822,9 @@ - (id)createFeedbackGenerator:(id)args
MAKE_SYSTEM_PROP(FEEDBACK_GENERATOR_IMPACT_STYLE_HEAVY, UIImpactFeedbackStyleHeavy);
#endif

#if IS_SDK_IOS_11
MAKE_SYSTEM_PROP(LARGE_TITLE_DISPLAY_MODE_AUTOMATIC, UINavigationItemLargeTitleDisplayModeAutomatic);
MAKE_SYSTEM_PROP(LARGE_TITLE_DISPLAY_MODE_ALWAYS, UINavigationItemLargeTitleDisplayModeAlways);
MAKE_SYSTEM_PROP(LARGE_TITLE_DISPLAY_MODE_NEVER, UINavigationItemLargeTitleDisplayModeNever);
#endif

#ifdef USE_TI_UIWEBVIEW

Expand Down Expand Up @@ -869,11 +867,9 @@ - (TiColor *)fetchSemanticColor:(id)color
{
ENSURE_SINGLE_ARG(color, NSString);

#if IS_SDK_IOS_11
if ([TiUtils isIOSVersionOrGreater:@"11.0"]) {
return [[TiColor alloc] initWithColor:[UIColor colorNamed:color] name:nil];
}
#endif
return [[TiColor alloc] initWithColor:UIColor.blackColor name:@"black"];
}

Expand Down
4 changes: 0 additions & 4 deletions iphone/Classes/TiUIiOSSplitWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,8 @@ - (void)setMasterView_:(id)args
RELEASE_TO_NIL(masterProxy);
masterProxy = [args retain];

#if IS_SDK_IOS_11
TiWindowProxy *masterWindowProxy = (TiWindowProxy *)masterProxy;
masterWindowProxy.isMasterWindow = YES;
#endif

if (viewsInitialized) {
[self initProxy:masterProxy withWrapper:masterViewWrapper];
Expand All @@ -282,10 +280,8 @@ - (void)setDetailView_:(id)args
RELEASE_TO_NIL(detailProxy);
detailProxy = [args retain];

#if IS_SDK_IOS_11
TiWindowProxy *detailWindowProxy = (TiWindowProxy *)detailProxy;
detailWindowProxy.isDetailWindow = YES;
#endif

if (viewsInitialized) {
[self initProxy:detailProxy withWrapper:detailViewWrapper];
Expand Down
2 changes: 0 additions & 2 deletions iphone/Classes/UIModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,8 @@ - (NSNumber *)ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_MIDDLE
MAKE_SYSTEM_STR(AUTOFILL_TYPE_URL, UITextContentTypeURL);
MAKE_SYSTEM_STR(AUTOFILL_TYPE_CARD_NUMBER, UITextContentTypeCreditCardNumber);

#if IS_SDK_IOS_11
MAKE_SYSTEM_STR(AUTOFILL_TYPE_USERNAME, UITextContentTypeUsername);
MAKE_SYSTEM_STR(AUTOFILL_TYPE_PASSWORD, UITextContentTypePassword);
#endif

#if IS_SDK_IOS_12
MAKE_SYSTEM_STR(AUTOFILL_TYPE_NEW_PASSWORD, UITextContentTypeNewPassword);
Expand Down
6 changes: 0 additions & 6 deletions iphone/iphone/Titanium_Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@
#else
#define IS_SDK_IOS_12 false
#endif

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
#define IS_SDK_IOS_11 true
#else
#define IS_SDK_IOS_11 false
#endif
4 changes: 2 additions & 2 deletions iphone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"minIosVersion": "9.0",
"minWatchosVersion": "2.0",
"vendorDependencies": {
"xcode": ">=8.0 <=11.x",
"ios sdk": ">=9.0 <=13.x"
"xcode": ">=9.0 <=11.x",
"ios sdk": ">=10.0 <=13.x"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit d5ede39

Please sign in to comment.