You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
832 B
34 lines
832 B
//
|
|
// TableView.swift
|
|
// TournamentStats
|
|
//
|
|
// Created by Laurent Morvillier on 06/08/2019.
|
|
// Copyright © 2019 Stax River. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
class TableView<T : ColumnRepresentable> : UITableView {
|
|
|
|
var wrapper: DataSourceWrapper<T>
|
|
|
|
init(data: [T], frame: CGRect, style: UITableView.Style) {
|
|
|
|
self.wrapper = DataSourceWrapper(array: data)
|
|
|
|
super.init(frame: frame, style: style)
|
|
|
|
self.register(UINib(nibName: "StackTableCell", bundle: Bundle.main), forCellReuseIdentifier: "Cell")
|
|
self.backgroundColor = UIColor.clear
|
|
|
|
self.dataSource = self.wrapper
|
|
self.delegate = self.wrapper
|
|
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
}
|
|
|