Configured and applied SwiftFormat

This commit is contained in:
Stefan Ceriu
2022-09-27 10:17:22 +03:00
committed by Stefan Ceriu
parent ff2e6ddfa7
commit 43c28d23b7
663 changed files with 2329 additions and 2840 deletions
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,12 +14,11 @@
// limitations under the License.
//
import Foundation
import DesignKit
import Foundation
// Conformance of MXPushRule to the abstraction `NotificationPushRule` for use in `NotificationSettingsViewModel`.
extension MXPushRule: NotificationPushRuleType {
/// Given a rule, check it match the actions in the static definition.
/// - Parameter standardActions: The standard actions to match against.
/// - Returns: Wether `this` rule matches the standard actions.
@@ -27,7 +26,7 @@ extension MXPushRule: NotificationPushRuleType {
guard let standardActions = standardActions else {
return false
}
if !enabled && standardActions == .disabled {
if !enabled, standardActions == .disabled {
return true
}
@@ -75,10 +74,10 @@ extension MXPushRule: NotificationPushRuleType {
}
var notify: Bool {
return getAction(actionType: MXPushRuleActionTypeNotify) != nil
getAction(actionType: MXPushRuleActionTypeNotify) != nil
}
var dontNotify: Bool {
return getAction(actionType: MXPushRuleActionTypeDontNotify) != nil
getAction(actionType: MXPushRuleActionTypeDontNotify) != nil
}
}
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +20,6 @@ struct MockNotificationPushRule: NotificationPushRuleType {
var ruleId: String!
var enabled: Bool
func matches(standardActions: NotificationStandardActions?) -> Bool {
return false
false
}
}
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,11 +33,11 @@ extension NotificationIndex {
/// - Parameter enabled: Enabled/Disabled state.
/// - Returns: The associated NotificationIndex
static func index(when enabled: Bool) -> NotificationIndex {
return enabled ? .noisy : .off
enabled ? .noisy : .off
}
/// Used to map from the checked state back to the index.
var enabled: Bool {
return self != .off
self != .off
}
}
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,7 +16,6 @@
import Foundation
extension NotificationPushRuleId {
/// A static definition of the push rule actions.
///
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,7 +32,6 @@ enum NotificationPushRuleId: String {
case keywords = "_keywords"
}
extension NotificationPushRuleId: Identifiable {
var id: String {
rawValue
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@ import Foundation
extension NotificationSettingsScreen: CaseIterable { }
extension NotificationSettingsScreen: Identifiable {
var id: Int { self.rawValue }
var id: Int { rawValue }
}
extension NotificationSettingsScreen {
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");