|
@@ -21,22 +21,16 @@ class KMQucikToolsModel: NSObject {
|
|
|
}
|
|
|
|
|
|
static func showType() -> [DataNavigationViewButtonActionType] {
|
|
|
- if UserDefaults.standard.object(forKey: "kQucikToolsShowType") != nil {
|
|
|
- let array: [NSNumber] = UserDefaults.standard.object(forKey: "kQucikToolsShowType") as! [NSNumber]
|
|
|
- if array.count != 0 {
|
|
|
- var types: [DataNavigationViewButtonActionType] = []
|
|
|
- for index in array {
|
|
|
- if DataNavigationViewButtonActionType(rawValue: Int(truncating: index)) != nil {
|
|
|
- types.append(DataNavigationViewButtonActionType(rawValue: Int(truncating: index))!)
|
|
|
- }
|
|
|
- }
|
|
|
- return types
|
|
|
- } else {
|
|
|
- return []
|
|
|
- }
|
|
|
- } else {
|
|
|
+ guard let array = UserDefaults.standard.array(forKey: "kQucikToolsShowType") as? [NSNumber], !array.isEmpty else {
|
|
|
return self.allType()
|
|
|
}
|
|
|
+
|
|
|
+ return array.compactMap { index in
|
|
|
+ guard let type = DataNavigationViewButtonActionType(rawValue: index.intValue) else {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return type
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static func hiddenType() -> [DataNavigationViewButtonActionType] {
|