RemoteNetworkCell.swift 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*****************************************************************************
  2. * RemoteNetworkCell.swift
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2018 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Carola Nitz <nitz.carola # googlemail.com>
  9. *
  10. * Refer to the COPYING file of the official project for license.
  11. *****************************************************************************/
  12. import UIKit
  13. class VLCRemoteNetworkCell: UITableViewCell {
  14. @objc static var cellIdentifier = "RemoteNetworkCell"
  15. override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
  16. super.init(style: .subtitle, reuseIdentifier: reuseIdentifier)
  17. commonInit()
  18. }
  19. required init?(coder aDecoder: NSCoder) {
  20. super.init(coder: aDecoder)
  21. commonInit()
  22. }
  23. func commonInit() {
  24. NotificationCenter.default.addObserver(self, selector: #selector(updateTheme), name: .VLCThemeDidChangeNotification, object: nil)
  25. accessoryType = .disclosureIndicator
  26. updateTheme()
  27. }
  28. @objc func updateTheme() {
  29. backgroundColor = PresentationTheme.current.colors.background
  30. textLabel?.textColor = PresentationTheme.current.colors.cellTextColor
  31. detailTextLabel?.textColor = PresentationTheme.current.colors.cellDetailTextColor
  32. }
  33. }