Add SwiftFormat to the project. (#129)

* Run swiftformat for whitespace.
* Run swiftformat with some rules.
This commit is contained in:
Doug
2022-07-06 14:49:05 +01:00
committed by GitHub
parent 26d8affaa8
commit 02eb4b35e2
188 changed files with 759 additions and 717 deletions
@@ -14,8 +14,8 @@
// limitations under the License.
//
import SwiftUI
import Combine
import SwiftUI
struct HomeScreenCoordinatorParameters {
let userSession: UserSessionProtocol
@@ -108,12 +108,11 @@ final class HomeScreenCoordinator: Coordinator, Presentable {
}
// MARK: - Public
func start() {
}
func start() { }
func toPresentable() -> UIViewController {
return self.hostingController
hostingController
}
// MARK: - Private
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,14 +34,14 @@ struct HomeScreenViewState: BindableState {
var userDisplayName: String?
var userAvatar: UIImage?
var showSessionVerificationBanner: Bool = false
var showSessionVerificationBanner = false
var rooms: [HomeScreenRoom] = []
var isLoadingRooms: Bool = false
var isLoadingRooms = false
var visibleDMs: [HomeScreenRoom] {
searchFilteredRooms.filter { $0.isDirect }
searchFilteredRooms.filter(\.isDirect)
}
var visibleRooms: [HomeScreenRoom] {
@@ -62,7 +62,7 @@ struct HomeScreenViewState: BindableState {
}
struct HomeScreenViewStateBindings {
var searchQuery: String = ""
var searchQuery = ""
}
struct HomeScreenRoom: Identifiable, Equatable {
@@ -14,8 +14,8 @@
// limitations under the License.
//
import SwiftUI
import Combine
import SwiftUI
typealias HomeScreenViewModelType = StateStoreViewModel<HomeScreenViewState, HomeScreenViewAction>
@@ -65,7 +65,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
roomUpdateListeners.removeAll()
roomSummaries.forEach({ roomSummary in
roomSummaries.forEach { roomSummary in
roomSummary.callbacks
.receive(on: DispatchQueue.main)
.sink { [weak self] callback in
@@ -81,7 +81,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
}
}
.store(in: &roomUpdateListeners)
})
}
}
@@ -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");
@@ -167,7 +167,7 @@ struct RoomCell: View {
}
private func roomName(_ room: HomeScreenRoom) -> String {
room.displayName ?? room.id + (room.isEncrypted ? "🛡": "")
room.displayName ?? room.id + (room.isEncrypted ? "🛡" : "")
}
}