-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows users to view a history of all errors that occured when performing app operations.
- Loading branch information
1 parent
6d081c2
commit 6ec47bb
Showing
8 changed files
with
591 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// ErrorLogTableViewCell.swift | ||
// AltStore | ||
// | ||
// Created by Riley Testut on 9/9/22. | ||
// Copyright © 2022 Riley Testut. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@objc(ErrorLogTableViewCell) | ||
class ErrorLogTableViewCell: UITableViewCell | ||
{ | ||
@IBOutlet var appIconImageView: AppIconImageView! | ||
|
||
@IBOutlet var dateLabel: UILabel! | ||
@IBOutlet var errorFailureLabel: UILabel! | ||
@IBOutlet var errorCodeLabel: UILabel! | ||
@IBOutlet var errorDescriptionTextView: CollapsingTextView! | ||
|
||
@IBOutlet var menuButton: UIButton! | ||
|
||
private var didLayoutSubviews = false | ||
|
||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? | ||
{ | ||
let moreButtonFrame = self.convert(self.errorDescriptionTextView.moreButton.frame, from: self.errorDescriptionTextView) | ||
guard moreButtonFrame.contains(point) else { return super.hitTest(point, with: event) } | ||
|
||
// Pass touches through menuButton so user can press moreButton. | ||
return self.errorDescriptionTextView.moreButton | ||
} | ||
|
||
override func layoutSubviews() | ||
{ | ||
super.layoutSubviews() | ||
|
||
self.didLayoutSubviews = true | ||
} | ||
|
||
override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize | ||
{ | ||
if !self.didLayoutSubviews | ||
{ | ||
// Ensure cell is laid out so it will report correct size. | ||
self.layoutIfNeeded() | ||
} | ||
|
||
let size = super.systemLayoutSizeFitting(targetSize, withHorizontalFittingPriority: horizontalFittingPriority, verticalFittingPriority: verticalFittingPriority) | ||
return size | ||
} | ||
} |
Oops, something went wrong.