【发布时间】:2020-04-05 19:37:57
【问题描述】:
我想从我的应用中打开优步应用,此时分数将高于 25。这是我的代码:
scoreLabel.text = "\(score)"
if score <= 5
{ promilLabel.text = "Trzezwy"
}
else if score <= 10{
promilLabel.text = "Wesoly"
}
else if score <= 15{
promilLabel.text = "Pijany"
}
else if score <= 25{
promilLabel.text = "Napierdolony"
}
else{
promilLabel.text = "Wytrzezwialka"
}
}
我找到了这样的东西,但是如何将它添加到else语句中?:
if let url = NSURL(string: "app://") where UIApplication.sharedApplication().canOpenURL(url) {
UIApplication.sharedApplication().openURL(url)
} else if let itunesUrl = NSURL(string: "https://itunes.apple.com/itunes-link-to-app") where UIApplication.sharedApplication().canOpenURL(itunesUrl) {
UIApplication.sharedApplication().openURL(itunesUrl)
}
【问题讨论】:
标签: ios swift if-statement url-scheme