//
//  SileoTableViewCell.swift
//  Sileo
//
//  Created by CoolStar on 9/8/19.
//  Copyright © 2019 Sileo Team. All rights reserved.
//

import Foundation

class SileoTableViewCell: UITableViewCell {
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        self.backgroundColor = .clear
        
        weak var weakSelf = self
        NotificationCenter.default.addObserver(weakSelf as Any,
                                               selector: #selector(updateSileoColors),
                                               name: SileoThemeManager.sileoChangedThemeNotification,
                                               object: nil)
        self.textLabel?.textColor = .sileoLabel
        self.selectedBackgroundView = SileoSelectionView(frame: .zero)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    @objc func updateSileoColors() {
        self.textLabel?.textColor = .sileoLabel
    }
}
