mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-30 09:10:29 +00:00
38 lines
1.1 KiB
Swift
38 lines
1.1 KiB
Swift
|
// Copyright © 2021 Metabolist. All rights reserved.
|
||
|
|
||
|
import UIKit
|
||
|
|
||
|
final class EmojiCategoryHeaderView: UICollectionReusableView {
|
||
|
let label = UILabel()
|
||
|
|
||
|
override init(frame: CGRect) {
|
||
|
super.init(frame: frame)
|
||
|
|
||
|
initialSetup()
|
||
|
}
|
||
|
|
||
|
@available(*, unavailable)
|
||
|
required init?(coder: NSCoder) {
|
||
|
fatalError("init(coder:) has not been implemented")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private extension EmojiCategoryHeaderView {
|
||
|
func initialSetup() {
|
||
|
backgroundColor = .clear
|
||
|
|
||
|
addSubview(label)
|
||
|
label.translatesAutoresizingMaskIntoConstraints = false
|
||
|
label.adjustsFontForContentSizeCategory = true
|
||
|
label.font = .preferredFont(forTextStyle: .headline)
|
||
|
label.textColor = .secondaryLabel
|
||
|
|
||
|
NSLayoutConstraint.activate([
|
||
|
label.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor),
|
||
|
label.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor),
|
||
|
label.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
|
||
|
label.bottomAnchor.constraint(equalTo: layoutMarginsGuide.bottomAnchor)
|
||
|
])
|
||
|
}
|
||
|
}
|