44 lines
872 B
Swift
44 lines
872 B
Swift
//
|
|
// SettingItem.swift
|
|
// Earthquake Network
|
|
//
|
|
// Created by Busi Andrea on 25/08/2020.
|
|
// Copyright © 2020 Earthquake Network. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
|
|
@objc enum SettingType: Int {
|
|
case detail
|
|
case enable
|
|
case slider
|
|
case multiValues
|
|
}
|
|
|
|
@objcMembers
|
|
class SettingItem: NSObject {
|
|
let title: String
|
|
let subtitle: String?
|
|
let icon: String?
|
|
let segue: String?
|
|
let type: SettingType
|
|
|
|
var displayTitle: String {
|
|
if let icon = icon {
|
|
return "\(icon) \(title)"
|
|
}
|
|
return title
|
|
}
|
|
|
|
// MARK: - Init
|
|
|
|
init(type: SettingType, title: String, subtitle: String? = nil, icon: String? = nil, segue: String? = nil) {
|
|
self.title = title
|
|
self.subtitle = subtitle
|
|
self.icon = icon
|
|
self.segue = segue
|
|
self.type = type
|
|
}
|
|
}
|