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
@@ -6,8 +6,8 @@
// Copyright © 2022 Element. All rights reserved.
//
import UIKit
import Kingfisher
import UIKit
struct MediaProvider: MediaProviderProtocol {
private let clientProxy: ClientProxyProtocol
@@ -21,7 +21,7 @@ struct MediaProvider: MediaProviderProtocol {
self.clientProxy = clientProxy
self.imageCache = imageCache
self.backgroundTaskService = backgroundTaskService
self.processingQueue = DispatchQueue(label: "MediaProviderProcessingQueue", attributes: .concurrent)
processingQueue = DispatchQueue(label: "MediaProviderProcessingQueue", attributes: .concurrent)
}
func imageFromSource(_ source: MediaSource?) -> UIImage? {
@@ -23,6 +23,6 @@ struct MediaSource: Equatable {
// MARK: - Equatable
static func == (lhs: MediaSource, rhs: MediaSource) -> Bool {
return lhs.underlyingSource.url() == rhs.underlyingSource.url()
lhs.underlyingSource.url() == rhs.underlyingSource.url()
}
}
@@ -12,18 +12,18 @@ import UIKit
struct MockMediaProvider: MediaProviderProtocol {
func imageFromSource(_ source: MediaSource?) -> UIImage? {
return nil
nil
}
func loadImageFromSource(_ source: MediaSource) async -> Result<UIImage, MediaProviderError> {
return .failure(.failedRetrievingImage)
.failure(.failedRetrievingImage)
}
func imageFromURLString(_ urlString: String?) -> UIImage? {
return nil
nil
}
func loadImageFromURLString(_ urlString: String) async -> Result<UIImage, MediaProviderError> {
return .failure(.failedRetrievingImage)
.failure(.failedRetrievingImage)
}
}