2021-02-23 15:14:10 +01:00
//
2022-01-05 08:11:35 +01:00
// O n b o a r d i n g H e a d l i n e T a b l e V i e w C e l l . s w i f t
2021-02-23 15:14:10 +01:00
// M a s t o d o n
//
// C r e a t e d b y B r a d G a o o n 2 0 2 1 / 2 / 2 3 .
//
import UIKit
2022-01-27 14:23:39 +01:00
import MastodonAsset
import MastodonLocalization
2021-02-23 15:14:10 +01:00
2022-01-05 08:11:35 +01:00
final class OnboardingHeadlineTableViewCell : UITableViewCell {
2021-02-23 15:14:10 +01:00
let titleLabel : UILabel = {
let label = UILabel ( )
2022-01-05 08:11:35 +01:00
label . font = MastodonPickServerViewController . largeTitleFont
label . textColor = MastodonPickServerViewController . largeTitleTextColor
2021-02-23 15:14:10 +01:00
label . text = L10n . Scene . ServerPicker . title
label . adjustsFontForContentSizeCategory = true
label . numberOfLines = 0
return label
} ( )
2022-01-04 11:30:21 +01:00
let subTitleLabel : UILabel = {
let label = UILabel ( )
2022-01-05 08:11:35 +01:00
label . font = MastodonPickServerViewController . subTitleFont
label . textColor = MastodonPickServerViewController . subTitleTextColor
2022-01-04 11:30:21 +01:00
label . text = " Pick a community based on your interests, region, or a general purpose one. Each community is operated by an entirely independent organization or individual. "
label . adjustsFontForContentSizeCategory = true
label . numberOfLines = 0
return label
} ( )
2021-02-23 15:14:10 +01:00
override init ( style : UITableViewCell . CellStyle , reuseIdentifier : String ? ) {
super . init ( style : style , reuseIdentifier : reuseIdentifier )
_init ( )
}
required init ? ( coder : NSCoder ) {
super . init ( coder : coder )
_init ( )
}
}
2022-01-05 08:11:35 +01:00
extension OnboardingHeadlineTableViewCell {
2021-02-23 15:14:10 +01:00
private func _init ( ) {
2021-03-06 05:55:52 +01:00
selectionStyle = . none
2022-02-15 11:15:58 +01:00
backgroundColor = Asset . Scene . Onboarding . background . color
2021-10-08 12:10:06 +02:00
let container = UIStackView ( )
container . axis = . vertical
2022-01-04 11:30:21 +01:00
container . spacing = 16
2021-10-08 12:10:06 +02:00
container . translatesAutoresizingMaskIntoConstraints = false
contentView . addSubview ( container )
2021-02-23 15:14:10 +01:00
NSLayoutConstraint . activate ( [
2021-10-08 12:10:06 +02:00
container . topAnchor . constraint ( equalTo : contentView . topAnchor ) ,
container . leadingAnchor . constraint ( equalTo : contentView . readableContentGuide . leadingAnchor ) ,
container . trailingAnchor . constraint ( equalTo : contentView . readableContentGuide . trailingAnchor ) ,
2022-01-04 11:30:21 +01:00
contentView . bottomAnchor . constraint ( equalTo : container . bottomAnchor , constant : 11 ) ,
2021-02-23 15:14:10 +01:00
] )
2021-10-08 12:10:06 +02:00
container . addArrangedSubview ( titleLabel )
2022-01-04 11:30:21 +01:00
container . addArrangedSubview ( subTitleLabel )
2021-10-08 12:10:06 +02:00
}
2021-02-23 15:14:10 +01:00
}