|
@ -37,12 +37,42 @@ class LauncherScreenViewController: UIViewController { |
|
|
override func viewDidAppear(_ animated: Bool) { |
|
|
override func viewDidAppear(_ animated: Bool) { |
|
|
super.viewDidAppear(animated) |
|
|
super.viewDidAppear(animated) |
|
|
|
|
|
|
|
|
|
|
|
#if DEBUG |
|
|
|
|
|
switch server { |
|
|
|
|
|
case .ngrok: |
|
|
|
|
|
let alert = UIAlertController(title: "ngrok", message: "Set your ngrok code", preferredStyle: .alert) |
|
|
|
|
|
alert.addTextField { |
|
|
|
|
|
$0.text = GMEDB.shared.app.string(.ngrokHost) |
|
|
|
|
|
$0.sendActions(for: .editingChanged) |
|
|
|
|
|
$0.clearButtonMode = .whileEditing |
|
|
|
|
|
} |
|
|
|
|
|
let ok = UIAlertAction(title: "Set", style: .default) { _ in |
|
|
|
|
|
GMEDB.shared.app.set(alert.textFields?[0].text, .ngrokHost) |
|
|
|
|
|
|
|
|
|
|
|
if !self.isShow { |
|
|
|
|
|
self.setEntryPoint() |
|
|
|
|
|
self.isShow = true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
alert.addAction(ok) |
|
|
|
|
|
|
|
|
|
|
|
self.present(alert, animated: true, completion: nil) |
|
|
|
|
|
default: |
|
|
if !isShow { |
|
|
if !isShow { |
|
|
setEntryPoint() |
|
|
setEntryPoint() |
|
|
isShow = true |
|
|
isShow = true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
|
|
|
if !isShow { |
|
|
|
|
|
setEntryPoint() |
|
|
|
|
|
isShow = true |
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
// https://f9df355b.ngrok.io |
|
|
// MARK: IBActions |
|
|
// MARK: IBActions |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|