Kurdtvs-Live-Kurdish-TV-Kur.../Mastodon/Scene/Onboarding/PickServer/CollectionViewCell/PickServerCategoryCollectio...

46 lines
1.2 KiB
Swift
Raw Normal View History

//
// PickServerCategoryCollectionViewCell.swift
// Mastodon
//
// Created by BradGao on 2021/2/23.
//
import UIKit
class PickServerCategoryCollectionViewCell: UICollectionViewCell {
2022-01-04 11:30:21 +01:00
var observations = Set<NSKeyValueObservation>()
2022-01-04 11:30:21 +01:00
var categoryView = PickServerCategoryView()
override func prepareForReuse() {
super.prepareForReuse()
observations.removeAll()
}
override init(frame: CGRect) {
super.init(frame: .zero)
configure()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
configure()
}
}
extension PickServerCategoryCollectionViewCell {
private func configure() {
2022-01-04 11:30:21 +01:00
backgroundColor = .clear
2022-01-04 11:30:21 +01:00
categoryView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(categoryView)
NSLayoutConstraint.activate([
2022-01-04 11:30:21 +01:00
categoryView.topAnchor.constraint(equalTo: contentView.topAnchor),
categoryView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
categoryView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
2022-01-04 11:30:21 +01:00
contentView.bottomAnchor.constraint(equalTo: categoryView.bottomAnchor),
])
}
}