mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 08:43:27 +01:00
Finish Riley's monster commit
3b38d725d7
May the Gods have mercy on my soul.
This commit is contained in:
53
AltStore/Settings/Error Log/ErrorDetailsViewController.swift
Normal file
53
AltStore/Settings/Error Log/ErrorDetailsViewController.swift
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// ErrorDetailsViewController.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 10/5/22.
|
||||
// Copyright © 2022 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
import AltStoreCore
|
||||
|
||||
class ErrorDetailsViewController: UIViewController
|
||||
{
|
||||
var loggedError: LoggedError?
|
||||
|
||||
@IBOutlet private var textView: UITextView!
|
||||
|
||||
override func viewDidLoad()
|
||||
{
|
||||
super.viewDidLoad()
|
||||
|
||||
if let error = self.loggedError?.error
|
||||
{
|
||||
self.title = error.localizedErrorCode
|
||||
|
||||
let font = self.textView.font ?? UIFont.preferredFont(forTextStyle: .body)
|
||||
let detailedDescription = error.formattedDetailedDescription(with: font)
|
||||
self.textView.attributedText = detailedDescription
|
||||
}
|
||||
else
|
||||
{
|
||||
self.title = NSLocalizedString("Error Details", comment: "")
|
||||
}
|
||||
|
||||
self.navigationController?.navigationBar.tintColor = .altPrimary
|
||||
|
||||
if #available(iOS 15, *), let sheetController = self.navigationController?.sheetPresentationController
|
||||
{
|
||||
sheetController.detents = [.medium(), .large()]
|
||||
sheetController.selectedDetentIdentifier = .medium
|
||||
sheetController.prefersGrabberVisible = true
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidLayoutSubviews()
|
||||
{
|
||||
super.viewDidLayoutSubviews()
|
||||
|
||||
self.textView.textContainerInset.left = self.view.layoutMargins.left
|
||||
self.textView.textContainerInset.right = self.view.layoutMargins.right
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user