InStatEventlistView

InStatEventlistView is a UI component in which the logic of interaction with buttons is encapsulated: play, download, share, check and select viewpoints.

InStatEventlistView

Usage

Code

To use InStatEventlistView in code, you simply create a new instance

  fileprivate lazy var eventlistView: InStatEventlistView = {
  
    let eventlist = InStatEventlistView()
    eventlist.dataSource = self
    eventlist.delegate = self
    eventlist.translatesAutoresizingMaskIntoConstraints = false
    return eventlist
  }()
Swift

and add it as a subview to your desired view:

  override func viewDidLoad() {
    super.viewDidLoad()
    view.addSubview(eventlistView)
  }
Swift

Delegate

You can use InStatEventlistViewDelegate to handle events

  func eventlistView(_ eventlistView: InStatEventlistView, heightForHeaderInSection section: Int) -> CGFloat
  func eventlistView(_ eventlistView: InStatEventlistView, didSelect item: Row, at indexPath: IndexPath)
  func eventlistView(_ eventlistView: InStatEventlistView, didDeselect item: Row, at indexPath: IndexPath)
  func eventlistView(_ eventlistView: InStatEventlistView, didShare item: Row, at indexPath: IndexPath)
  func eventlistView(_ eventlistView: InStatEventlistView, didDownload item: Row, at indexPath: IndexPath)
  func eventlistView(_ eventlistView: InStatEventlistView, didChangePlaySelectionState state: Bool, forItem item: Row, at indexPath: IndexPath)
Swift

and InStatEventlistViewDataSource to populate the component with data

  func numberOfSections(in eventlistView: InStatEventlistView) -> Int
  func eventlistView(_ eventlistView: InStatEventlistView, numberOfRowsInSection section: Int) -> Int
  func setEvents(for eventlistView: InStatEventlistView) -> [Section]
Swift

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

InStatEventlistView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'InStatEventlistView'
Ruby

GitHub

Latest commit to the undefined branch on unknown
Download as zip