MOJailBrokenDector 将 JailBrokenDector 项目转换成 Swift 语言。
如何使用:
// using do-try-catch do { try MOJailBrokenDector.isBroken() } catch JailBrokenError.Detected(let fileName) { print("Device is broken : \(fileName)") } catch { print("Error : \(error)") } // using guard guard let isBroken: Bool? = try? MOJailBrokenDector.isBroken() where isBroken != nil else { print("Device is broken") return; }