Skip to content

Commit

Permalink
CordovaLib.xcodeproj file upgraded for Xcode 10 (#489)
Browse files Browse the repository at this point in the history
* Update CordovaLib.xcodeproj to Xcode 10 standards
* Resolve some deprecation warnings in CordovaLib
* Update Travis CI to include Xcode 10
  • Loading branch information
dpogue authored and erisu committed Jan 30, 2019
1 parent 31ef0cd commit 11b136c
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 451 deletions.
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
language: objective-c
osx_image: xcode9.3
sudo: false

env:
matrix:
- TRAVIS_NODE_VERSION: '6'
- TRAVIS_NODE_VERSION: '8'
- TRAVIS_NODE_VERSION: '10'
matrix:
include:
# Run one test with Xcode 9.x, the rest with 10.1
- osx_image: xcode9.3
env: TRAVIS_NODE_VERSION=10
- osx_image: xcode10.1
env: TRAVIS_NODE_VERSION=6
- osx_image: xcode10.1
env: TRAVIS_NODE_VERSION=8
- osx_image: xcode10.1
env: TRAVIS_NODE_VERSION=10

before_install:
- nvm install $TRAVIS_NODE_VERSION
Expand All @@ -23,7 +28,6 @@ script:
- npm run unit-tests
- npm run test:component
- npm run e2e-tests
- open -b com.apple.iphonesimulator
- npm run objc-tests
- npm run cover

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,7 @@ + (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIW
// only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
// it's a UIWebViewNavigationTypeOther, and it's an internal link
if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
// CB-11895; openURL with a single parameter is deprecated in iOS 10
// see https://useyourloaf.com/blog/openurl-deprecated-in-ios10
if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
} else {
[[UIApplication sharedApplication] openURL:url];
}
#else
// fall back if on older SDK
[[UIApplication sharedApplication] openURL:url];
#endif
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}

// consume the request (i.e. no error) if it wasn't handled above
Expand Down
10 changes: 5 additions & 5 deletions CordovaLib/Classes/Public/CDVAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(N

// this happens while we are running ( in the background, or from within our own app )
// only valid if 40x-Info.plist specifies a protocol to handle
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
if (!url) {
return NO;
Expand All @@ -83,12 +83,12 @@ - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplic

[openURLData setValue:url forKey:@"url"];

if (sourceApplication) {
[openURLData setValue:sourceApplication forKey:@"sourceApplication"];
if (options[UIApplicationOpenURLOptionsSourceApplicationKey]) {
[openURLData setValue:options[UIApplicationOpenURLOptionsSourceApplicationKey] forKey:@"sourceApplication"];
}

if (annotation) {
[openURLData setValue:annotation forKey:@"annotation"];
if (options[UIApplicationOpenURLOptionsAnnotationKey]) {
[openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"];
}

// all plugins will get the notification, and their handlers will be called
Expand Down
10 changes: 0 additions & 10 deletions CordovaLib/Classes/Public/CDVViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -601,16 +601,6 @@ - (void)didReceiveMemoryWarning
// Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload
{
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;

[CDVUserAgentUtil releaseLock:&_userAgentLockToken];

[super viewDidUnload];
}

#pragma mark CordovaCommands

- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
Expand Down
751 changes: 339 additions & 412 deletions CordovaLib/CordovaLib.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1010"
version = "1.7">
<BuildAction
parallelizeBuildables = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down

0 comments on commit 11b136c

Please sign in to comment.