64 lines
1.3 KiB
Swift
64 lines
1.3 KiB
Swift
//
|
|
// OpenSourceTableViewCell.swift
|
|
// Pods
|
|
//
|
|
// Created by Florian Gabach on 05/02/2017.
|
|
//
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class OpenSourceTableViewCell: UITableViewCell {
|
|
|
|
// MARK: IBOutlet
|
|
|
|
@IBOutlet var licenceTitle: UILabel!
|
|
@IBOutlet var licenceDesc: UILabel!
|
|
|
|
// MARK: - Lifecycle
|
|
|
|
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
|
super.init(style: .default,
|
|
reuseIdentifier: reuseIdentifier)
|
|
|
|
self.prepareCellComponent()
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
super.init(coder: aDecoder)
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
}
|
|
|
|
override func layoutSubviews() {
|
|
super.layoutSubviews()
|
|
}
|
|
|
|
// MARK: - Prepare
|
|
|
|
func prepareCellComponent() {
|
|
// Text
|
|
self.textLabel?.numberOfLines = 0
|
|
|
|
// Common init
|
|
self.accessoryType = .none
|
|
self.selectionStyle = .none
|
|
}
|
|
|
|
// MARK: - Configure
|
|
|
|
/// Initialize the cell content with Licence model
|
|
///
|
|
/// - Parameter licence: the licence model
|
|
func configure(licence: LicenceFile) {
|
|
|
|
// Library's name
|
|
self.licenceTitle.text = licence.title
|
|
|
|
// Library licence's detail
|
|
self.licenceDesc.text = licence.detail
|
|
}
|
|
}
|