// // CrashReporterViewController.swift // Tusker // // Created by Shadowfacts on 3/29/22. // Copyright © 2022 Shadowfacts. All rights reserved. // import UIKit import CrashReporter class CrashReporterViewController: IssueReporterViewController { private let report: PLCrashReport override var preamble: String { "Tusker has detected that it crashed the last time it was running. You can email the report to the developer or skip sending and continue to the app. You may review the report below before sending.\n\nIf you choose to send the report, please include any additional details about what you were doing prior to the crash that may be pertinent." } override var subject: String { "Tusker Crash Report" } static func create(report: PLCrashReport, delegate: IssueReporterViewControllerDelegate) -> UINavigationController { return create(CrashReporterViewController(report: report, delegate: delegate)) } private init(report: PLCrashReport, delegate: IssueReporterViewControllerDelegate) { self.report = report let reportText = PLCrashReportTextFormatter.stringValue(for: report, with: PLCrashReportTextFormatiOS)! let timestamp = ISO8601DateFormatter().string(from: report.systemInfo.timestamp) let reportFilename = "Tusker-crash-\(timestamp).crash" super.init(reportText: reportText, reportFilename: reportFilename, delegate: delegate) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func viewDidLoad() { super.viewDidLoad() navigationItem.title = NSLocalizedString("Crash Detected", comment: "crash reporter title") } }