Мне нужно символизировать apple cra sh log
У меня нет сбоев при запуске приложения на всех поддерживаемых устройствах в симуляторе XCode, но рецензент Apple говорит мне, что мой При запуске приложения происходит сбой, и отправляет мне этот журнал cra sh, если кто-то может символизировать этот журнал cra sh, чтобы я мог найти cra sh. Это ссылка на файл cra sh -log.txt
Это мой главный V C, если он помогает найти cra sh
@IBOutlet weak var aboutBarBtn: UIBarButtonItem!
@IBOutlet weak var homeBarBtn: UIBarButtonItem!
@IBAction func homeBarBtn(_ sender: UIBarButtonItem) {
loadContent()
}
@IBOutlet weak var webView: WKWebView!
private var failedAt: URL?
private lazy var offlineImg: UIImageView = {
let image = UIImageView(image: #imageLiteral(resourceName: "90713124_3084925348192795_4212473017332137984_n"))
image.contentMode = .scaleAspectFit
return image
}()
private lazy var offlineTitleLbl: UILabel = {
let label = UILabel()
label.text = "Opps!.."
label.font = UIFont.boldSystemFont(ofSize: 18)
label.textAlignment = .center
return label
}()
private lazy var offlineMessageLbl: UILabel = {
let label = UILabel()
label.text = "We couldn't load the next page on this connection please try again"
label.font = UIFont.systemFont(ofSize: 16)
label.numberOfLines = 0
label.textAlignment = .center
return label
}()
private lazy var offlineTryAgainBtn: UIButton = {
let button = UIButton()
button.setTitle("Try Again", for: .normal)
button.setTitleColor(.systemRed, for: .normal)
button.layer.borderColor = UIColor.systemRed.cgColor
button.layer.borderWidth = 1.0
button.addTarget(self, action: #selector(self.onTryAgainBtnPressed(_:)), for: .touchUpInside)
return button
}()
private lazy var offlineView: UIView = {
let view = UIView()
return UIView()
}()
override func viewDidLoad() {
super.viewDidLoad()
homeBarBtn.image = #imageLiteral(resourceName: "home")
aboutBarBtn.image = #imageLiteral(resourceName: "info")
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert, .badge]) { (granted, error) in
if let e = error {
print ("Failed to authorize notification from user.\(e)")
}
}
let content = UNMutableNotificationContent()
content.title = "مرحباً بك في الزاوية الخامسة"
content.body = "أولي خطواتك لتحقيق أحلامك ريادة صناعة المستقبل"
let date = Date(timeIntervalSinceNow: 5)
let dateComponeent = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponeent, repeats: false)
let uuidString = UUID().uuidString
let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)
center.add(request) { (error) in
if let e = error {
print(e)
}
}
webView.navigationDelegate = self
start()
}
@objc func onTryAgainBtnPressed(_ sender: Any) {
self.offlineView.removeFromSuperview()
start()
}
private func start() {
if let connection = try? Reachability().connection {
switch connection {
case .cellular, .wifi:
loadContent()
default:
displayOfflineView()
}
} else {
displayOfflineView()
}
}
private func loadContent() {
if let url = failedAt {
webView.load(URLRequest(url: url))
}else if let url = URL(string: "Link here") {
webView.load(URLRequest(url: url))
} else {
displayOfflineView()
}
}
private func displayOfflineView() {
view.addSubview(offlineView)
view.bringSubviewToFront(offlineView)
offlineView.snp.makeConstraints { maker in
maker.edges.equalTo(self.view.safeAreaLayoutGuide)
}
offlineView.addSubview(offlineImg)
offlineImg.snp.makeConstraints { maker in
// maker.top.equalToSuperview().offset(30)
maker.size.equalTo(120)
maker.centerX.equalToSuperview()
}
offlineView.addSubview(offlineTitleLbl)
offlineTitleLbl.snp.makeConstraints { maker in
maker.top.equalTo(offlineImg.snp.bottom).offset(20)
maker.width.equalToSuperview().inset(40)
maker.centerX.equalToSuperview()
}
offlineView.addSubview(offlineMessageLbl)
offlineMessageLbl.snp.makeConstraints { maker in
maker.top.equalTo(offlineTitleLbl.snp.bottom).offset(8)
maker.width.equalToSuperview().inset(40)
maker.centerY.equalToSuperview()
maker.centerX.equalToSuperview()
}
offlineView.addSubview(offlineTryAgainBtn)
offlineTryAgainBtn.snp.makeConstraints { maker in
maker.top.equalTo(offlineMessageLbl.snp.bottom).offset(30)
maker.leading.trailing.equalToSuperview().inset(30)
maker.height.equalTo(50)
maker.centerX.equalToSuperview()
}
}
}
extension ViewController: WKNavigationDelegate {
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
HUD.show(.progress)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
HUD.hide()
}
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
self.failedAt = webView.url
HUD.flash(.labeledError(title: "Opps!..", subtitle: error.localizedDescription))
displayOfflineView()
}
}