SHOW:
|
|
- or go back to the newest paste.
| 1 | - | import UIKit |
| 1 | + | var tests:[Test] |
| 2 | - | import Firebase |
| 2 | + | |
| 3 | ||
| 4 | - | class Test: DatabaseProtocol {
|
| 4 | + | |
| 5 | - | |
| 5 | + | override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
| 6 | - | var isHidden: Bool = false |
| 6 | + | if indexPath.row == 0 {
|
| 7 | - | |
| 7 | + | return 15 |
| 8 | - | var modifiedTimeInterval: TimeInterval = Date().timeIntervalSince1970 |
| 8 | + | } |
| 9 | - | |
| 9 | + | else if (indexPath.row == 1 && (tests[testIndex].imagesURL.isEmpty && !checkMode)) || (indexPath.row == 2 && (!tests[testIndex].imagesURL.isEmpty || checkMode)) {
|
| 10 | - | var creationTimeInterval: TimeInterval = Date().timeIntervalSince1970 |
| 10 | + | return 0.1 |
| 11 | - | |
| 11 | + | } |
| 12 | - | var deletionTimeInterval: TimeInterval = 0.0 |
| 12 | + | else if (indexPath.row == 7 && (tests[testIndex].imagesURL.isEmpty && !checkMode)) || (indexPath.row == 8 && (!tests[testIndex].imagesURL.isEmpty || checkMode)) {
|
| 13 | - | |
| 13 | + | return 20 |
| 14 | - | var excludeProperties: [String] = ["modifiedDate","creationDate"] |
| 14 | + | } |
| 15 | - | |
| 15 | + | else if indexPath.row == 1 && !tests[testIndex].imagesURL.isEmpty && !checkMode {
|
| 16 | - | var databaseID = "" |
| 16 | + | return 215 |
| 17 | - | var databasePath = "" |
| 17 | + | } |
| 18 | - | |
| 18 | + | else if indexPath.row == 1 && checkMode {
|
| 19 | - | var imagesURL:[String] = [] |
| 19 | + | return 150 |
| 20 | - | var text = "" |
| 20 | + | } |
| 21 | - | var options:[String] = [] |
| 21 | + | else if (indexPath.row == 2 && (tests[testIndex].imagesURL.isEmpty && !checkMode)) || (indexPath.row == 3 && (!tests[testIndex].imagesURL.isEmpty || checkMode)) {
|
| 22 | - | |
| 22 | + | return UITableViewAutomaticDimension |
| 23 | - | var rightOption = "" |
| 23 | + | } |
| 24 | - | |
| 24 | + | else if (indexPath.row == 8 && (tests[testIndex].imagesURL.isEmpty && !checkMode)) || (indexPath.row == 9 && (!tests[testIndex].imagesURL.isEmpty || checkMode)) {
|
| 25 | - | init() {}
|
| 25 | + | return 75 |
| 26 | - | |
| 26 | + | } |
| 27 | - | required init(fromDictionary dictionary: [String : Any]) throws {
|
| 27 | + | else {
|
| 28 | - | databaseID = dictionary.optionalFrom("databaseID") ?? ""
|
| 28 | + | return UITableViewAutomaticDimension |
| 29 | - | databasePath = dictionary.optionalFrom("databasePath") ?? ""
|
| 29 | + | } |
| 30 | - | imagesURL = try dictionary.primaryTypeArrayFrom("imagesURL")
|
| 30 | + | } |