2021-06-28 13:41:41 +02:00
//
// C o m p o s e R e p l i e d T o S t a t u s C o n t e n t T a b l e V i e w C e l l . s w i f t
// M a s t o d o n
//
// C r e a t e d b y M a i n a s u K C i r n o o n 2 0 2 1 - 6 - 2 8 .
//
import UIKit
import Combine
final class ComposeRepliedToStatusContentTableViewCell : UITableViewCell {
var disposeBag = Set < AnyCancellable > ( )
2022-01-27 14:23:39 +01:00
let statusView = StatusView ( )
2021-06-28 13:41:41 +02:00
let framePublisher = PassthroughSubject < CGRect , Never > ( )
override func prepareForReuse ( ) {
super . prepareForReuse ( )
disposeBag . removeAll ( )
2022-01-27 14:23:39 +01:00
statusView . prepareForReuse ( )
2021-06-28 13:41:41 +02:00
}
override init ( style : UITableViewCell . CellStyle , reuseIdentifier : String ? ) {
super . init ( style : style , reuseIdentifier : reuseIdentifier )
_init ( )
}
required init ? ( coder : NSCoder ) {
super . init ( coder : coder )
_init ( )
}
override func layoutSubviews ( ) {
super . layoutSubviews ( )
framePublisher . send ( bounds )
}
}
extension ComposeRepliedToStatusContentTableViewCell {
private func _init ( ) {
2021-06-29 10:41:58 +02:00
selectionStyle = . none
2021-06-28 13:41:41 +02:00
backgroundColor = . clear
statusView . translatesAutoresizingMaskIntoConstraints = false
contentView . addSubview ( statusView )
NSLayoutConstraint . activate ( [
statusView . topAnchor . constraint ( equalTo : contentView . topAnchor , constant : 20 ) . identifier ( " statusView.top to ComposeRepliedToStatusContentCollectionViewCell.contentView.top " ) ,
2022-01-27 14:23:39 +01:00
statusView . leadingAnchor . constraint ( equalTo : contentView . leadingAnchor ) ,
contentView . trailingAnchor . constraint ( equalTo : statusView . trailingAnchor ) ,
2021-06-28 13:41:41 +02:00
contentView . bottomAnchor . constraint ( equalTo : statusView . bottomAnchor , constant : 10 ) . identifier ( " ComposeRepliedToStatusContentCollectionViewCell.contentView.bottom to statusView.bottom " ) ,
] )
2022-01-27 14:23:39 +01:00
statusView . setup ( style : . composeStatusReplica )
2021-06-28 13:41:41 +02:00
}
}