diff options
author | Thierry Crozat | 2019-08-04 16:14:46 +0100 |
---|---|---|
committer | Thierry Crozat | 2019-08-04 19:03:34 +0100 |
commit | c505a7b4bb14c532a2f343fd27032bd97ad716b7 (patch) | |
tree | 33c6302ae18e458deb1a1e0ef50e31c7219b9e8b /backends/platform/ios7/ios7_osys_video.mm | |
parent | 0ddcb9de7bd72ca2db82d12c1d9d56493169766b (diff) | |
download | scummvm-rg350-c505a7b4bb14c532a2f343fd27032bd97ad716b7.tar.gz scummvm-rg350-c505a7b4bb14c532a2f343fd27032bd97ad716b7.tar.bz2 scummvm-rg350-c505a7b4bb14c532a2f343fd27032bd97ad716b7.zip |
IOS7: Implement opening a URL
Diffstat (limited to 'backends/platform/ios7/ios7_osys_video.mm')
-rw-r--r-- | backends/platform/ios7/ios7_osys_video.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 05093e5428..f0a7db6265 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -642,3 +642,16 @@ bool OSystem_iOS7::setTextInClipboard(const Common::String &text) { [pb setString:[NSString stringWithCString:text.c_str() encoding:encoding]]; return true; } + +bool OSystem_iOS7::openUrl(const Common::String &url) { + UIApplication *application = [UIApplication sharedApplication]; + NSURL *nsurl = [NSURL URLWithString:[NSString stringWithCString:url.c_str() encoding:NSISOLatin1StringEncoding]]; + // The way to oipen a URL has changed in iOS 10. Check if the iOS 10 method is recognized + // and otherwise use the old method. + if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) { + [application openURL:nsurl options:@{} completionHandler:nil]; + return true; + } else { + return [application openURL:nsurl]; + } +} |