99import UIKit
1010
1111class BusStopTableViewCell : UITableViewCell {
12-
12+
1313 let linePosition : CGFloat = DetailIconView . width - 16 // max of DetailIconView (114) - constant (16) = 98
14-
14+
1515 var titleLabel : UILabel !
1616 let cellHeight : CGFloat = RouteDetailCellSize . smallHeight
1717 let cellWidth : CGFloat = RouteDetailCellSize . indentedWidth
18-
18+
1919 var connectorTop : UIView !
2020 var connectorBottom : UIView !
2121 var statusCircle : Circle !
22-
22+
2323 override init ( style: UITableViewCell . CellStyle , reuseIdentifier: String ? ) {
2424 super. init ( style: style, reuseIdentifier: reuseIdentifier)
25-
25+
2626 titleLabel = UILabel ( )
2727 titleLabel. frame = CGRect ( x: cellWidth, y: 0 , width: UIScreen . main. bounds. width - cellWidth - 20 , height: 20 )
2828 titleLabel. font = . getFont( . regular, size: 14 )
@@ -33,34 +33,34 @@ class BusStopTableViewCell: UITableViewCell {
3333 titleLabel. sizeToFit ( )
3434 titleLabel. center. y = cellHeight / 2
3535 contentView. addSubview ( titleLabel)
36-
36+
3737 connectorTop = UIView ( frame: CGRect ( x: linePosition, y: 0 , width: 4 , height: cellHeight / 2 ) )
3838 connectorTop. frame. origin. x -= connectorTop. frame. width / 2
3939 connectorTop. backgroundColor = Colors . tcatBlue
4040 contentView. addSubview ( connectorTop)
41-
41+
4242 connectorBottom = UIView ( frame: CGRect ( x: linePosition, y: cellHeight / 2 , width: 4 , height: cellHeight / 2 ) )
4343 connectorBottom. frame. origin. x -= connectorBottom. frame. width / 2
4444 connectorBottom. backgroundColor = Colors . tcatBlue
4545 contentView. addSubview ( connectorBottom)
46-
46+
4747 statusCircle = Circle ( size: . small, style: . outline, color: Colors . tcatBlue)
4848 statusCircle. center = self . center
4949 statusCircle. center. y = cellHeight / 2
5050 statusCircle. frame. origin. x = linePosition - ( statusCircle. frame. width / 2 )
5151 contentView. addSubview ( statusCircle)
52-
52+
5353 }
54-
54+
5555 required init ? ( coder aDecoder: NSCoder ) {
5656 fatalError ( " init(coder:) has not been implemented " )
5757 }
58-
58+
5959 func setCell( _ name: String ) {
6060 titleLabel. text = name
6161 titleLabel. sizeToFit ( )
6262 titleLabel. frame. size. width = UIScreen . main. bounds. width - cellWidth - 20
6363 titleLabel. center. y = cellHeight / 2
6464 }
65-
65+
6666}
0 commit comments