I recently implemented Crashlytics inside my app and used the following to implement it:
import UIKit
import Crashlytics
class ViewController: UIViewController{
override func viewDidLoad() {
super.viewDidLoad()
let button = UIButton(type: .roundedRect)
button.frame = CGRect(x: 20, y: 50, width: 100, height: 30)
button.setTitle("Crash", for: [])
button.addTarget(self, action: #selector(self.crashButtonTapped(_:)), for: .touchUpInside)
view.addSubview(button)
}
@IBAction func crashButtonTapped(_ sender: AnyObject) {
Crashlytics.sharedInstance().crash()
}
}
When tested the app crashes with the error Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) and when I check the crashlytics logs it doesn't register the crash. Is there something wrong with my implementation?
