Вот мои решения:
extension UIDevice {
func isJailBroken() -> Bool {
var jailBroken = false
let cydiaPath = "/Applications/Cydia.app"
let aptPath = "/private/var/lib/apt/"
if FileManager.default.fileExists(atPath: cydiaPath) {
jailBroken = true
}
if FileManager.default.fileExists(atPath: aptPath) {
jailBroken = true
}
return jailBroken
}
}
и вызовите его внутри viewDidLoad()
внутри контроллера вида экрана запуска (или любого другого виртуального канала, которому вы звоните впервые):
if UIDevice.current.isJailBroken() {
// show a blank screen or some other view controller
let jailbreakVC = JailBrokenViewController()
self.navigationController?.present(jailbreakVC, animated: true, completion:nil)
} else {
// continue executing your next View controller
let nextVC = NextViewController()
self.navigationController?.present(nextVC, animated: true, completion:nil)
}