Files
ContainerController/Example/ContainerControllerSwift/ExamplesSettings/UI/Cell/ExampleCell.swift
T
2020-06-10 15:00:22 +03:00

58 lines
1.2 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// ExampleCell.swift
// ContainerController
//
// Created by Рустам Мотыгуллин on 28/05/2020.
// Copyright © 2020 mrusta. All rights reserved.
//
import UIKit
import ContainerControllerSwift
// MARK: - Cell Delegate
protocol ExampleCellDelegate {
func exampleCell(_ cell: TableAdapterCell, type: ExampleCell.Style, value: CGFloat, endEditing: Bool)
}
// MARK: - Cell Data
class ExampleCellData: TableAdapterCellData {
var delegate: ExampleCellDelegate?
var callback: ((Int) -> Void)?
var type: ExampleCell.Style
var title: String
var cellSizeHeight: CGFloat?
init(_ type: ExampleCell.Style,
_ title: String?,
_ cellHeight: CGFloat?,
_ delegate: ExampleCellDelegate?,
_ callback: ((Int) -> Void)?) {
self.type = type
if type != .default {
self.title = type.rawValue
} else {
self.title = title ?? ""
}
self.delegate = delegate
self.callback = callback
self.cellSizeHeight = cellHeight
super.init()
}
override public func cellHeight() -> CGFloat {
return cellSizeHeight ?? 51.0
}
}