forked from shadowfacts/Tusker
Make tapping content warning label toggle expand/collapse
This commit is contained in:
parent
ba1300b1b7
commit
b7a4f7e30f
|
@ -22,7 +22,7 @@ protocol StatusCollectionViewCell: UICollectionViewCell {
|
|||
var displayNameLabel: EmojiLabel { get }
|
||||
var usernameLabel: UILabel { get }
|
||||
var contentWarningLabel: EmojiLabel { get }
|
||||
var collapseButton: UIButton { get }
|
||||
var collapseButton: StatusCollapseButton { get }
|
||||
var contentContainer: StatusContentContainer { get }
|
||||
var replyButton: UIButton { get }
|
||||
var favoriteButton: UIButton { get }
|
||||
|
|
|
@ -122,10 +122,11 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
]), size: 0)
|
||||
// this needs to have a higher priorty than the content container's zero height constraint
|
||||
$0.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
||||
$0.isUserInteractionEnabled = true
|
||||
$0.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(collapseButtonPressed)))
|
||||
}
|
||||
|
||||
private(set) lazy var collapseButton = UIButton(configuration: {
|
||||
private(set) lazy var collapseButton = StatusCollapseButton(configuration: {
|
||||
var config = UIButton.Configuration.filled()
|
||||
config.image = UIImage(systemName: "chevron.down")
|
||||
return config
|
||||
|
|
Loading…
Reference in New Issue