LoadingTableViewCell.swift 646 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // LoadingTableViewCell.swift
  3. // LoopKitUI
  4. //
  5. // Created by Pete Schwamb on 10/24/18.
  6. // Copyright © 2018 LoopKit Authors. All rights reserved.
  7. //
  8. import Foundation
  9. import UIKit
  10. open class LoadingTableViewCell: UITableViewCell {
  11. public var isLoading = false {
  12. didSet {
  13. if isLoading {
  14. let indicator = UIActivityIndicatorView(style: .default)
  15. accessoryView = indicator
  16. indicator.startAnimating()
  17. } else {
  18. accessoryView = nil
  19. }
  20. loadingStatusChanged()
  21. }
  22. }
  23. open func loadingStatusChanged() {}
  24. }