mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-06 15:08:50 +00:00
Differential Revision: D19141253 fbshipit-source-id: 9ed4c278a91bb48a1f6d33cafa9ce8f21861573d
46 lines
1.1 KiB
Swift
46 lines
1.1 KiB
Swift
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import IGListKit
|
|
import UIKit
|
|
|
|
final class MonthTitleCell: UICollectionViewCell {
|
|
|
|
fileprivate lazy var label: UILabel = {
|
|
let view = UILabel()
|
|
view.backgroundColor = .clear
|
|
view.textAlignment = .center
|
|
view.textColor = UIColor(white: 0.7, alpha: 1)
|
|
view.font = .boldSystemFont(ofSize: 13)
|
|
self.contentView.addSubview(view)
|
|
return view
|
|
}()
|
|
|
|
var text: String? {
|
|
get {
|
|
return label.text
|
|
}
|
|
set {
|
|
label.text = newValue
|
|
}
|
|
}
|
|
|
|
override func layoutSubviews() {
|
|
super.layoutSubviews()
|
|
label.frame = contentView.bounds
|
|
}
|
|
|
|
}
|
|
|
|
extension MonthTitleCell: ListBindable {
|
|
|
|
func bindViewModel(_ viewModel: Any) {
|
|
guard let viewModel = viewModel as? MonthTitleViewModel else { return }
|
|
label.text = viewModel.name.uppercased()
|
|
}
|
|
|
|
}
|