mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-13 04:09:25 +00:00
fix(ios): fixes sys-kbd setup help link for iOS 9 and 10
This commit is contained in:
parent
785cf0448d
commit
93ff4e0886
1 changed files with 11 additions and 8 deletions
|
|
@ -44,12 +44,15 @@ class SetUpViewController: UIViewController, UIWebViewDelegate {
|
|||
}
|
||||
|
||||
func reloadKeymanHelp() {
|
||||
let networkStatus = networkReachable?.connection
|
||||
switch networkStatus {
|
||||
case Reachability.Connection.none?:
|
||||
if let networkStatus = networkReachable?.connection {
|
||||
switch networkStatus {
|
||||
case Reachability.Connection.none, Reachability.Connection.unavailable:
|
||||
loadFromLocal()
|
||||
default:
|
||||
loadFromServer()
|
||||
}
|
||||
} else {
|
||||
loadFromLocal()
|
||||
default:
|
||||
loadFromServer()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,16 +65,16 @@ class SetUpViewController: UIViewController, UIWebViewDelegate {
|
|||
|
||||
// Yes, .php.html. That's how `wget` is set to retrieve it, since Safari won't recognize the contents
|
||||
// without the .html ending, it seems.
|
||||
let filePath = offlineHelpBundle.path(forResource: "installing-system-keyboard.php",
|
||||
let filePath = offlineHelpBundle.path(forResource: "installing-system-keyboard",
|
||||
ofType: "html",
|
||||
inDirectory: nil)
|
||||
inDirectory: "start")
|
||||
webView.loadRequest(URLRequest(url: URL.init(fileURLWithPath: filePath!)))
|
||||
}
|
||||
|
||||
private func loadFromServer() {
|
||||
let appVersion = Version.current.majorMinor
|
||||
let url = "https://help.keyman.com/products/iphone-and-ipad/\(appVersion.plainString)"
|
||||
+ "/installing-system-keyboard.php?embed=ios"
|
||||
+ "/start/installing-system-keyboard"
|
||||
webView.loadRequest(URLRequest(url: URL(string: url)!))
|
||||
log.debug("Set up page URL: \(url)")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue