我在我的函数中的 Crashlytics 报告闭包 #2 中得到了这个,下一行是 @escaping @callee_guaranteed () -> () ()
这是我的职能:
func myFunction() {
var isLogin = false
let group = DispatchGroup()
group.enter()
let greetUser = { (name: String) in
if name != nil {
isLogin = true
group.leave()
} else {
isLogin = false
group.leave()
}
}
greetUser("reportMe")
group.notify(queue: .main, work: DispatchWorkItem(block: { [weak self] in
Crashlytics.crashlytics().setCustomValue(Date(), forKey: "Date")
Crashlytics.crashlytics().setCustomValue("https://example.com/", forKey: "URL")
Crashlytics.crashlytics().setCustomValue("wah ada error nih", forKey: "error")
Crashlytics.crashlytics().setCustomValue(true, forKey: "is_login")
Crashlytics.crashlytics().setCustomValue("10.10.10.101", forKey: "ip_address")
Crashlytics.crashlytics().setUserID("123456")
let error = NSError(domain: "https://example.com/", code: 101, userInfo: nil)
Crashlytics.crashlytics().log("Report Me")
Crashlytics.crashlytics().record(error: error)
self?.showToast(message: "Crash Reported for Firebase Crashlytics to test whatever it received or not in Crashlytics", font: .systemFont(ofSize: 12.0))
}))
}
如何修复我的函数中的代码,使 @escaping @callee_guaranteed () -> () 的闭包 #2 thunk 不再出现在我的 crashlytics 报告中?