Files
GitHawk/Classes/Section Controllers/LoadMore/LoadMoreCell.swift
Joe Rocca 9851a45cd6 Adds light gray text color on selection of LoadMoreCell (#711)
* added light gray text color on selection

* change label alpha instead of color
2017-10-24 21:45:37 -04:00

55 lines
1.3 KiB
Swift

//
// LoadMoreCell.swift
// Freetime
//
// Created by Sherlock, James on 28/07/2017.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import UIKit
import SnapKit
final class LoadMoreCell: UICollectionViewCell {
private let label = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
accessibilityTraits |= UIAccessibilityTraitButton
isAccessibilityElement = true
label.font = Styles.Fonts.button
label.textColor = Styles.Colors.Gray.light.color
contentView.addSubview(label)
label.snp.makeConstraints { make in
make.center.equalTo(contentView)
}
label.text = NSLocalizedString("Load More", comment: "")
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func layoutSubviews() {
super.layoutSubviews()
layoutContentViewForSafeAreaInsets()
}
override var accessibilityLabel: String? {
get { return NSLocalizedString("Load More", comment: "") }
set { }
}
override var isSelected: Bool {
didSet {
if isSelected {
label.alpha = 0.5
} else {
label.alpha = 1
}
}
}
}