Skip to content

Instantly share code, notes, and snippets.

@catqbat
Created May 3, 2017 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catqbat/dff664afc2cd502268d5667e21ac4627 to your computer and use it in GitHub Desktop.
Save catqbat/dff664afc2cd502268d5667e21ac4627 to your computer and use it in GitHub Desktop.
class LocationCell : UICollectionViewCell
{
@IBOutlet weak var locationNameLabel: UILabel!;
static let locationNameFont:UIFont = UIFont.systemFont(ofSize: 17, weight: UIFontWeightThin);
var locationName: String
{
didSet
{
locationNameLabel.text = locationName;
}
}
override var isSelected: Bool
{
didSet
{
locationNameLabel.textColor = isSelected ? UIColor.yellow : UIColor.white;
}
}
required init?(coder aDecoder: NSCoder)
{
self.locationName = "";
super.init(coder: aDecoder);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment