| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //
- // BaseTableViewCell.swift
- // Gasteizko Margolariak
- //
- // Created by Inigo Valentin on 2016-08-23
- // Copyright © 2016 Inigo Valentin. All rights reserved.
- //
- // Based on the work of Yuji Hato.
- //
- import UIKit
- public class BaseTableViewCell : UITableViewCell {
- class var identifier: String { return String.className(self) }
-
- public required init?(coder aDecoder: NSCoder) {
- super.init(coder: aDecoder)
- setup()
- }
-
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
- super.init(style: style, reuseIdentifier: reuseIdentifier)
- setup()
- }
-
- public override func awakeFromNib() {
- }
-
- public func setup() {
- }
-
- public class func height() -> CGFloat {
- return 48
- }
-
- public func setData(data: Any?) {
- self.backgroundColor = UIColor(hex: "4c9ed8")
- //self.textLabel?.font = UIFont.italicSystemFontOfSize(18)
- self.textLabel?.font = UIFont.boldSystemFontOfSize(19)
- self.textLabel?.textColor = UIColor(hex: "ffffff")
- if let menuText = data as? String {
- self.textLabel?.text = menuText
- }
- }
-
- override public func setHighlighted(highlighted: Bool, animated: Bool) {
- if highlighted {
- self.alpha = 0.4
- } else {
- self.alpha = 1.0
- }
- }
-
- // ignore the default handling
- override public func setSelected(selected: Bool, animated: Bool) {
- }
-
- }
|