Enable blank line rules. (#132)

This commit is contained in:
Doug 2022-07-06 16:01:50 +01:00 committed by GitHub
parent 02eb4b35e2
commit 25d7ba55ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
114 changed files with 0 additions and 184 deletions

View File

@ -3,8 +3,6 @@
--exclude ElementX/Sources/Generated
--disable wrapMultiLineStatementBraces
--disable blankLinesAtStartOfScope
--disable blankLinesAtEndOfScope
--disable hoistPatternLet
--commas inline

View File

@ -19,7 +19,6 @@ import SwiftUI
/// Fonts at https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1362%3A0
@objcMembers
public class ElementSharedFonts {
// MARK: - Types
/// A wrapper to provide both a `UIFont` and a SwiftUI `Font` in the same type.
@ -43,7 +42,6 @@ public class ElementSharedFonts {
// MARK: - Fonts protocol
public extension ElementSharedFonts {
var largeTitle: SharedFont {
let uiFont = font(forTextStyle: .largeTitle)
return SharedFont(uiFont: uiFont, font: .largeTitle)

View File

@ -20,7 +20,6 @@ import Foundation
/// Font names are based on Element typography https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1362%3A0 which is based on Apple font text styles (UIFont.TextStyle): https://developer.apple.com/documentation/uikit/uifonttextstyle
/// Create a custom TextStyle enum (like DesignKit.Fonts.TextStyle) is also a possibility
public protocol Fonts {
associatedtype FontType
/// The font for large titles.

View File

@ -17,7 +17,6 @@
import UIKit
public extension UIFont {
// MARK: - Convenient methods
/// Update current font with a SymbolicTraits

View File

@ -10,7 +10,6 @@ import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
private lazy var appCoordinator: Coordinator = isRunningUITests ? UITestsAppCoordinator() : AppCoordinator()
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {

View File

@ -9,7 +9,6 @@
import Foundation
final class BuildSettings {
// MARK: - Servers
static let defaultHomeserverURLString = "https://matrix.org"
@ -32,5 +31,4 @@ final class BuildSettings {
// MARK: - Room screen
static let defaultRoomTimelineStyle: TimelineStyle = .bubbles
}

View File

@ -21,7 +21,6 @@ import UIKit
/// It helps to isolate and reuse view controllers and pass dependencies down the navigation hierarchy.
@MainActor
protocol Coordinator: AnyObject {
/// Starts job of the coordinator.
func start()
@ -41,7 +40,6 @@ protocol Coordinator: AnyObject {
// `Coordinator` default implementation
extension Coordinator {
func add(childCoordinator coordinator: Coordinator) {
childCoordinators.append(coordinator)
}

View File

@ -9,10 +9,8 @@
import UIKit
class ElementNavigationController: UINavigationController {
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
navigationBar.topItem?.backButtonDisplayMode = .minimal
}
}

View File

@ -11,7 +11,6 @@ import SwiftUI
/// Store Element specific app settings.
final class ElementSettings: ObservableObject {
// MARK: - Constants
public enum UserDefaultsKeys: String {

View File

@ -9,7 +9,6 @@
import Foundation
public extension Bundle {
/// Get an lproj language bundle from the receiver bundle.
/// - Parameter language: The language to try to load.
/// - Returns: The lproj bundle if found otherwise nil.
@ -46,5 +45,4 @@ public extension Bundle {
.compactMap { $0 }
.filter { set.insert($0).inserted }
}
}

View File

@ -10,7 +10,6 @@ import DTCoreText
import Foundation
struct AttributedStringBuilder: AttributedStringBuilderProtocol {
private let temporaryBlockquoteMarkingColor = UIColor.magenta
private let temporaryCodeBlockMarkingColor = UIColor.cyan
private let linkColor = UIColor.blue
@ -159,7 +158,6 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
}
private func addLinks(_ attributedString: NSMutableAttributedString) {
let string = attributedString.string
let range = NSRange(location: 0, length: attributedString.string.count)

View File

@ -17,7 +17,6 @@ public extension DTHTMLElement {
/// - imageHandler: An optional image handler to be run on `img` tags (if allowed) to update the `src` attribute.
@objc func sanitize(font: UIFont) {
if let name = name, !Self.allowedHTMLTags.contains(name) {
// This is an unsupported tag.
// Remove any attachments to fix rendering.
textAttachment = nil

View File

@ -15,7 +15,6 @@ enum ImageAnonymizerError: Error {
}
enum ImageAnonymizer {
private static var allowedTextItems: [String] = [
"#",
"@",
@ -113,5 +112,4 @@ enum ImageAnonymizer {
}
return result
}
}

View File

@ -19,7 +19,6 @@ import SwiftyBeaver
/// Various MXLog configuration options. Used in conjunction with `MXLog.configure()`
@objc public class MXLogConfiguration: NSObject {
/// the desired log level. `.verbose` by default.
@objc public var logLevel = MXLogLevel.verbose
@ -58,7 +57,6 @@ private var logger: SwiftyBeaver.Type = {
Please see `MXLog.h` for Objective-C options.
*/
@objc public class MXLog: NSObject {
/// Method used to customize MXLog's behavior.
/// Called automatically when first accessing the logger with the default values.
/// Please see `MXLogConfiguration` for all available options.

View File

@ -28,9 +28,7 @@ struct NavigationModule {
// MARK: - CustomStringConvertible
extension NavigationModule: CustomStringConvertible {
var description: String {
"NavigationModule: \(presentable), pop completion: \(String(describing: popCompletion))"
}
}

View File

@ -18,7 +18,6 @@ import UIKit
/// `NavigationRouter` is a concrete implementation of NavigationRouterType.
final class NavigationRouter: NSObject, NavigationRouterType {
// MARK: - Properties
// MARK: Private
@ -117,7 +116,6 @@ final class NavigationRouter: NSObject, NavigationRouterType {
}
func setModules(_ modules: [NavigationModule], hideNavigationBar: Bool, animated: Bool) {
MXLog.debug("[NavigationRouter] Set modules \(modules)")
let controllers = modules.map { module -> UIViewController in
@ -279,7 +277,6 @@ final class NavigationRouter: NSObject, NavigationRouterType {
}
func contains(_ module: Presentable) -> Bool {
let controller = module.toPresentable()
return navigationController.viewControllers.contains(controller)
}
@ -293,7 +290,6 @@ final class NavigationRouter: NSObject, NavigationRouterType {
// MARK: - Private
private func module(for viewController: UIViewController) -> Presentable {
guard let module = storedModules[viewController] as? Presentable else {
return viewController
}
@ -339,7 +335,6 @@ final class NavigationRouter: NSObject, NavigationRouterType {
}
private func postNotification(withName name: Notification.Name, for viewController: UIViewController) {
let module = module(for: viewController)
let userInfo: [String: Any] = [
@ -354,14 +349,11 @@ final class NavigationRouter: NSObject, NavigationRouterType {
// MARK: - UINavigationControllerDelegate
extension NavigationRouter: UINavigationControllerDelegate {
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
// Try to post `NavigationRouter.willPopModule` notification here
}
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
// Ensure the view controller is popping
guard let poppedViewController = navigationController.transitionCoordinator?.viewController(forKey: .from),
!navigationController.viewControllers.contains(poppedViewController) else {
@ -377,7 +369,6 @@ extension NavigationRouter: UINavigationControllerDelegate {
// MARK: - NavigationRouter notification constants
extension NavigationRouter {
// MARK: Notification names
public static let willPushModule = Notification.Name("NavigationRouterWillPushModule")
@ -391,7 +382,6 @@ extension NavigationRouter {
// MARK: Notification keys
public enum NotificationUserInfoKey {
/// The associated view controller (UIViewController).
static let viewController = "viewController"

View File

@ -18,7 +18,6 @@ import UIKit
/// `NavigationRouterStore` enables to get a NavigationRouter from a UINavigationController instance.
class NavigationRouterStore: NavigationRouterStoreProtocol {
// MARK: - Constants
static let shared = NavigationRouterStore()
@ -39,7 +38,6 @@ class NavigationRouterStore: NavigationRouterStoreProtocol {
// MARK: - Public
func navigationRouter(for navigationController: UINavigationController) -> NavigationRouterType {
if let existingNavigationRouter = findNavigationRouter(for: navigationController) {
return existingNavigationRouter
}
@ -64,7 +62,6 @@ class NavigationRouterStore: NavigationRouterStoreProtocol {
}
@objc private func navigationRouterDidCreate(_ notification: Notification) {
guard let userInfo = notification.userInfo,
let navigationRouter = userInfo[NavigationRouter.NotificationUserInfoKey.navigationRouter] as? NavigationRouterType,
let navigationController = userInfo[NavigationRouter.NotificationUserInfoKey.navigationController] as? UINavigationController else {

View File

@ -19,7 +19,6 @@ import UIKit
/// `NavigationRouterStoreProtocol` describes a structure that enables to get a NavigationRouter from a UINavigationController instance.
@MainActor
protocol NavigationRouterStoreProtocol {
/// Gets the existing navigation router for the supplied controller, creating a new one if it doesn't yet exist.
/// Note: The store only holds a weak reference to the returned router. It is the caller's responsibility to retain it.
func navigationRouter(for navigationController: UINavigationController) -> NavigationRouterType

View File

@ -20,7 +20,6 @@ import UIKit
/// Routers are used to be passed between coordinators. They handles only `physical` navigation.
@MainActor
protocol NavigationRouterType: AnyObject, Presentable {
/// Present modally a view controller on the navigation controller
///
/// - Parameter module: The Presentable to present.
@ -91,7 +90,6 @@ protocol NavigationRouterType: AnyObject, Presentable {
// `NavigationRouterType` default implementation
extension NavigationRouterType {
func setRootModule(_ module: Presentable) {
setRootModule(module, hideNavigationBar: false, animated: false, popCompletion: nil)
}
@ -107,13 +105,11 @@ extension NavigationRouterType {
func setModules(_ modules: [Presentable], animated: Bool) {
setModules(modules, hideNavigationBar: false, animated: animated)
}
}
// MARK: - Presentable <--> NavigationModule Transitive Methods
extension NavigationRouterType {
func setRootModule(_ module: NavigationModule) {
setRootModule(module.presentable, popCompletion: module.popCompletion)
}
@ -132,5 +128,4 @@ extension NavigationRouterType {
push(modules.map { $0.toModule() },
animated: animated)
}
}

View File

@ -29,11 +29,9 @@ extension UIViewController: Presentable {
}
extension Presentable {
/// Returns a new module from the presentable without a pop completion block
/// - Returns: Module
func toModule() -> NavigationModule {
NavigationModule(presentable: self, popCompletion: nil)
}
}

View File

@ -18,7 +18,6 @@ import UIKit
/// `RootRouter` is a concrete implementation of RootRouterType.
final class RootRouter: RootRouterType {
// MARK: - Constants
// `rootViewController` animation constants
@ -69,7 +68,6 @@ final class RootRouter: RootRouterType {
// MARK: - Private methods
private func updateRootViewController(rootViewController: UIViewController?, animated: Bool, completion: (() -> Void)?) {
if animated {
UIView.transition(with: window, duration: RootViewControllerUpdateAnimation.duration, options: RootViewControllerUpdateAnimation.options, animations: {
let oldState: Bool = UIView.areAnimationsEnabled

View File

@ -20,7 +20,6 @@ import UIKit
/// Routers are used to be passed between coordinators. They handles only `physical` navigation.
@MainActor
protocol RootRouterType: AnyObject {
/// Update the root view controller
///
/// - Parameter module: The new root view controller to set

View File

@ -73,7 +73,6 @@ class ViewModelContext<ViewState: BindableState, ViewAction>: ObservableObject {
/// we can do it in this centralised place.
@MainActor
class StateStoreViewModel<State: BindableState, ViewAction> {
typealias Context = ViewModelContext<State, ViewAction>
// MARK: - Properties

View File

@ -10,7 +10,6 @@ import SwiftUI
/// A toggle style that uses a button, with a checked/unchecked image like a checkbox.
struct ElementToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View {
Button { configuration.isOn.toggle() } label: {
Image(systemName: configuration.isOn ? "checkmark.square.fill" : "square")

View File

@ -19,7 +19,6 @@ import UIKit
/// Used to present activity indicator on a view
final class ActivityIndicatorPresenter: ActivityIndicatorPresenterType {
// MARK: - Constants
private enum Constants {
@ -131,7 +130,6 @@ final class ActivityIndicatorPresenter: ActivityIndicatorPresenterType {
}
private extension UIView {
/// Add a subview matching parent view using autolayout
@objc func vc_addSubViewMatchingParent(_ subView: UIView) {
addSubview(subView)

View File

@ -17,7 +17,6 @@
import UIKit
final class ActivityIndicatorView: UIView {
// MARK: - Constants
private enum Constants {

View File

@ -18,7 +18,6 @@ import Foundation
import UIKit
class RectangleToastView: UIView {
private enum Constants {
static let padding = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16)
static let cornerRadius: CGFloat = 8.0

View File

@ -70,7 +70,6 @@ class RoundedToastView: UIView {
}
private func setup(viewState: ToastViewState) {
backgroundColor = .clear
clipsToBounds = true

View File

@ -9,7 +9,6 @@
import Foundation
public struct WeakDictionary<Key: Hashable, Value: AnyObject> {
private var storage: [Key: WeakDictionaryReference<Value>]
public init() {
@ -48,7 +47,6 @@ public struct WeakDictionary<Key: Hashable, Value: AnyObject> {
}
extension WeakDictionary: Collection {
public typealias Index = DictionaryIndex<Key, WeakDictionaryReference<Value>>
public var startIndex: Index {

View File

@ -9,7 +9,6 @@
import Foundation
public struct WeakDictionaryKey<Key: AnyObject & Hashable, Value: AnyObject>: Hashable {
private weak var baseKey: Key?
private let hash: Int
private var retainedValue: Value?

View File

@ -9,7 +9,6 @@
import Foundation
public struct WeakKeyDictionary<Key: AnyObject & Hashable, Value: AnyObject> {
private var storage: WeakDictionary<WeakDictionaryKey<Key, Value>, Value>
private let valuesRetainedByKey: Bool
@ -69,7 +68,6 @@ public struct WeakKeyDictionary<Key: AnyObject & Hashable, Value: AnyObject> {
}
extension WeakKeyDictionary: Collection {
public typealias Index = DictionaryIndex<WeakDictionaryKey<Key, Value>, WeakDictionaryReference<Value>>
public var startIndex: Index {

View File

@ -16,7 +16,6 @@ protocol AuthenticationCoordinatorDelegate: AnyObject {
}
class AuthenticationCoordinator: Coordinator, Presentable {
private let authenticationService: AuthenticationServiceProtocol
private let navigationRouter: NavigationRouter

View File

@ -18,7 +18,6 @@ import SwiftUI
/// An image that is styled for use as the screen icon in the onboarding flow.
struct AuthenticationIconImage: View {
let image: ImageAsset
var body: some View {

View File

@ -32,7 +32,6 @@ enum LoginCoordinatorAction {
}
final class LoginCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -85,5 +85,4 @@ extension LoginHomeserver {
isMatrixDotOrg: false,
loginMode: .unsupported)
}
}

View File

@ -19,7 +19,6 @@ import SwiftUI
typealias LoginViewModelType = StateStoreViewModel<LoginViewState, LoginViewAction>
class LoginViewModel: LoginViewModelType, LoginViewModelProtocol {
// MARK: - Properties
// MARK: Public

View File

@ -18,7 +18,6 @@ import Foundation
@MainActor
protocol LoginViewModelProtocol {
var callback: (@MainActor(LoginViewModelAction) -> Void)? { get set }
var context: LoginViewModelType.Context { get }

View File

@ -17,7 +17,6 @@
import SwiftUI
struct LoginScreen: View {
// MARK: - Properties
// MARK: Private
@ -54,7 +53,6 @@ struct LoginScreen: View {
default:
loginUnavailableText
}
}
.readableFrame()
.padding(.horizontal, 16)

View File

@ -19,7 +19,6 @@ import SwiftUI
/// A view that shows information about the chosen homeserver,
/// along with an edit button to pick a different one.
struct LoginServerInfoSection: View {
// MARK: - Public
/// The address shown for the server.

View File

@ -29,7 +29,6 @@ enum ServerSelectionCoordinatorAction {
}
final class ServerSelectionCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -19,7 +19,6 @@ import SwiftUI
typealias ServerSelectionViewModelType = StateStoreViewModel<ServerSelectionViewState, ServerSelectionViewAction>
class ServerSelectionViewModel: ServerSelectionViewModelType, ServerSelectionViewModelProtocol {
// MARK: - Properties
// MARK: Private

View File

@ -18,7 +18,6 @@ import Foundation
@MainActor
protocol ServerSelectionViewModelProtocol {
var callback: (@MainActor(ServerSelectionViewModelAction) -> Void)? { get set }
var context: ServerSelectionViewModelType.Context { get }

View File

@ -17,7 +17,6 @@
import SwiftUI
struct ServerSelectionScreen: View {
// MARK: - Properties
// MARK: Private

View File

@ -22,7 +22,6 @@ struct BugReportCoordinatorParameters {
}
final class BugReportCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -21,7 +21,6 @@ typealias BugReportViewModelType = StateStoreViewModel<BugReportViewState,
BugReportViewAction>
@available(iOS 14, *)
class BugReportViewModel: BugReportViewModelType, BugReportViewModelProtocol {
// MARK: - Properties
let bugReportService: BugReportServiceProtocol

View File

@ -18,7 +18,6 @@ import Foundation
@MainActor
protocol BugReportViewModelProtocol {
var callback: ((BugReportViewModelAction) -> Void)? { get set }
@available(iOS 14, *)
var context: BugReportViewModelType.Context { get }

View File

@ -17,7 +17,6 @@
import SwiftUI
struct BugReportScreen: View {
// MARK: Private
@Environment(\.horizontalSizeClass) private var horizontalSizeClass

View File

@ -30,7 +30,6 @@ enum HomeScreenCoordinatorAction {
}
final class HomeScreenCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -20,7 +20,6 @@ import SwiftUI
typealias HomeScreenViewModelType = StateStoreViewModel<HomeScreenViewState, HomeScreenViewAction>
class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol {
private let attributedStringBuilder: AttributedStringBuilderProtocol
private var roomUpdateListeners = Set<AnyCancellable>()
@ -82,7 +81,6 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
}
.store(in: &roomUpdateListeners)
}
}
func updateWithUserAvatar(_ avatar: UIImage) {

View File

@ -17,7 +17,6 @@
import SwiftUI
struct HomeScreen: View {
@ObservedObject var context: HomeScreenViewModel.Context
// MARK: Views
@ -30,7 +29,6 @@ struct HomeScreen: View {
ProgressView()
}
} else {
if context.viewState.showSessionVerificationBanner {
HStack {
Text(ElementL10n.verificationVerifyDevice)
@ -115,7 +113,6 @@ struct HomeScreen: View {
}
struct RoomCell: View {
@ScaledMetric private var avatarSize = 32.0
let room: HomeScreenRoom

View File

@ -24,7 +24,6 @@ struct RoomScreenCoordinatorParameters {
}
final class RoomScreenCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -19,7 +19,6 @@ import SwiftUI
typealias RoomScreenViewModelType = StateStoreViewModel<RoomScreenViewState, RoomScreenViewAction>
class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol {
private enum Constants {
static let backPaginationPageSize: UInt = 30
}

View File

@ -10,7 +10,6 @@ import Combine
import UIKit
class ListTableViewAdapter: NSObject, UITableViewDelegate {
private enum ContentOffsetDetails {
case topOffset(previousVisibleIndexPath: IndexPath, previousItemCount: Int)
case bottomOffset

View File

@ -9,7 +9,6 @@
import SwiftUI
struct MessageComposer: View {
@Binding var text: String
var disabled: Bool
let action: () -> Void

View File

@ -9,7 +9,6 @@
import SwiftUI
struct MessageComposerTextField: View {
@Binding private var text: String
@State private var dynamicHeight: CGFloat = 100
@State private var isEditing = false

View File

@ -13,7 +13,6 @@ import SwiftUI
import Introspect
struct RoomHeaderView: View {
@ObservedObject var context: RoomScreenViewModel.Context
var body: some View {
@ -49,7 +48,6 @@ struct RoomHeaderView: View {
.accessibilityIdentifier("roomAvatarPlaceholderImage")
}
}
}
struct RoomHeaderView_Previews: PreviewProvider {

View File

@ -17,7 +17,6 @@
import SwiftUI
struct RoomScreen: View {
@ObservedObject var context: RoomScreenViewModel.Context
var body: some View {

View File

@ -10,7 +10,6 @@ import Foundation
import SwiftUI
struct TimelineItemBubbledStylerView<Content: View>: View {
let timelineItem: EventBasedTimelineItemProtocol
@ViewBuilder let content: () -> Content
@ -96,7 +95,6 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
let opacity = colorScheme == .light ? 0.06 : 0.15
return timelineItem.isOutgoing ? .element.accent.opacity(opacity) : .element.system
}
}
struct TimelineItemBubbledStylerView_Previews: PreviewProvider {

View File

@ -10,7 +10,6 @@ import Foundation
import SwiftUI
struct TimelineItemPlainStylerView<Content: View>: View {
let timelineItem: EventBasedTimelineItemProtocol
@ViewBuilder let content: () -> Content

View File

@ -39,7 +39,6 @@ struct FormattedBodyText_Previews: PreviewProvider {
static var previews: some View {
body.preferredColorScheme(.light)
body.preferredColorScheme(.dark)
}
@ViewBuilder

View File

@ -17,7 +17,6 @@
import SwiftUI
struct PlaceholderAvatarImage: View {
private let textForImage: String
var body: some View {

View File

@ -9,7 +9,6 @@
import SwiftUI
public struct TimelineItemContextMenu: View {
let contextMenuActions: [TimelineItemContextMenuAction]
let callback: (TimelineItemContextMenuAction) -> Void

View File

@ -11,7 +11,6 @@ import Introspect
import SwiftUI
struct TimelineItemList: View {
@State private var tableViewObserver = ListTableViewAdapter()
@State private var timelineItems: [RoomTimelineViewProvider] = []
@State private var hasPendingChanges = false

View File

@ -10,7 +10,6 @@ import Foundation
import SwiftUI
struct TimelineSenderAvatarView: View {
let timelineItem: EventBasedTimelineItemProtocol
@ScaledMetric private var avatarSize = 26
@ -35,5 +34,4 @@ struct TimelineSenderAvatarView: View {
.animation(.default, value: timelineItem.senderAvatar)
}
}

View File

@ -13,7 +13,6 @@ import SwiftUI
import Introspect
struct TimelineView: View {
@State private var bottomVisiblePublisher = PassthroughSubject<Bool, Never>()
@State private var scrollToBottomPublisher = PassthroughSubject<Void, Never>()
@State private var scollToBottomButtonVisible = false

View File

@ -21,7 +21,6 @@ struct SessionVerificationCoordinatorParameters {
}
final class SessionVerificationCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -19,7 +19,6 @@ import SwiftUI
typealias SessionVerificationViewModelType = StateStoreViewModel<SessionVerificationViewState, SessionVerificationViewAction>
class SessionVerificationViewModel: SessionVerificationViewModelType, SessionVerificationViewModelProtocol {
// MARK: - Properties
// MARK: Private
@ -36,7 +35,6 @@ class SessionVerificationViewModel: SessionVerificationViewModelType, SessionVer
init(sessionVerificationControllerProxy: SessionVerificationControllerProxyProtocol,
initialState: SessionVerificationViewState = SessionVerificationViewState()) {
self.sessionVerificationControllerProxy = sessionVerificationControllerProxy
stateMachine = SessionVerificationStateMachine()

View File

@ -18,7 +18,6 @@ import MatrixRustSDK
import SwiftUI
struct SessionVerificationScreen: View {
@ObservedObject var context: SessionVerificationViewModel.Context
// MARK: Views

View File

@ -26,7 +26,6 @@ enum SettingsCoordinatorAction {
}
final class SettingsCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -21,7 +21,6 @@ typealias SettingsViewModelType = StateStoreViewModel<SettingsViewState,
SettingsViewAction>
@available(iOS 14, *)
class SettingsViewModel: SettingsViewModelType, SettingsViewModelProtocol {
// MARK: - Properties
// MARK: Private

View File

@ -18,7 +18,6 @@ import Foundation
@MainActor
protocol SettingsViewModelProtocol {
var callback: ((SettingsViewModelAction) -> Void)? { get set }
@available(iOS 14, *)
var context: SettingsViewModelType.Context { get }

View File

@ -17,7 +17,6 @@
import SwiftUI
struct SettingsScreen: View {
// MARK: Private
@State private var showingLogoutConfirmation = false

View File

@ -17,7 +17,6 @@
import SwiftUI
final class SplashScreenCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -38,7 +38,6 @@ enum SplashScreenViewModelAction {
// MARK: View
struct SplashScreenViewState: BindableState {
/// The colours of the background gradient shown behind the 4 pages.
private let gradientColors = [
Color(red: 0.95, green: 0.98, blue: 0.96),

View File

@ -20,7 +20,6 @@ import SwiftUI
typealias SplashScreenViewModelType = StateStoreViewModel<SplashScreenViewState, SplashScreenViewAction>
class SplashScreenViewModel: SplashScreenViewModelType, SplashScreenViewModelProtocol {
// MARK: - Properties
// MARK: Private

View File

@ -19,7 +19,6 @@ import SwiftUI
/// The splash screen shown at the beginning of the onboarding flow.
struct SplashScreen: View {
// MARK: - Properties
// MARK: Private
@ -47,7 +46,6 @@ struct SplashScreen: View {
// The main content of the carousel
HStack(alignment: .top, spacing: 0) {
// Add a hidden page at the start of the carousel duplicating the content of the last page
SplashScreenPageView(content: context.viewState.content[pageCount - 1])
.frame(width: geometry.size.width)
@ -57,7 +55,6 @@ struct SplashScreen: View {
SplashScreenPageView(content: context.viewState.content[index])
.frame(width: geometry.size.width)
}
}
.offset(x: pageOffset(in: geometry))

View File

@ -17,7 +17,6 @@
import SwiftUI
struct SplashScreenPageIndicator: View {
// MARK: - Properties
// MARK: Public

View File

@ -17,7 +17,6 @@
import SwiftUI
struct SplashScreenPageView: View {
// MARK: - Properties
// MARK: Public

View File

@ -10,7 +10,6 @@ import Foundation
import MatrixRustSDK
class AuthenticationService: AuthenticationServiceProtocol {
// MARK: - Properties
// MARK: Private

View File

@ -9,15 +9,12 @@
import Foundation
protocol BackgroundTaskServiceProtocol {
func startBackgroundTask(withName name: String,
isReusable: Bool,
expirationHandler: (() -> Void)?) -> BackgroundTaskProtocol?
}
extension BackgroundTaskServiceProtocol {
func startBackgroundTask(withName name: String) -> BackgroundTaskProtocol? {
startBackgroundTask(withName: name,
expirationHandler: nil)
@ -36,5 +33,4 @@ extension BackgroundTaskServiceProtocol {
isReusable: false,
expirationHandler: expirationHandler)
}
}

View File

@ -11,7 +11,6 @@ import UIKit
/// /// UIKitBackgroundTaskService is a concrete implementation of BackgroundTaskServiceProtocol using a given `ApplicationProtocol` instance.
class UIKitBackgroundTaskService: BackgroundTaskServiceProtocol {
private let application: ApplicationProtocol?
private var reusableTasks: WeakDictionary<String, UIKitBackgroundTask> = WeakDictionary()
@ -91,7 +90,6 @@ class UIKitBackgroundTaskService: BackgroundTaskServiceProtocol {
}
return false
}
}
private extension TimeInterval {

View File

@ -213,7 +213,6 @@ class BugReportService: BugReportServiceProtocol {
return zippedFiles
}
}
private extension Data {

View File

@ -14,7 +14,6 @@ struct SubmitBugReportResponse: Decodable {
}
protocol BugReportServiceProtocol {
var crashedLastRun: Bool { get }
func crash()

View File

@ -10,7 +10,6 @@ import Foundation
import UIKit
class MockBugReportService: BugReportServiceProtocol {
func submitBugReport(text: String,
includeLogs: Bool,
includeCrashLog: Bool,
@ -24,5 +23,4 @@ class MockBugReportService: BugReportServiceProtocol {
func crash() {
// no-op
}
}

View File

@ -17,7 +17,6 @@ enum ScreenshotDetectorError: String, Error {
@MainActor
class ScreenshotDetector {
var callback: (@MainActor(UIImage?, Error?) -> Void)?
/// Flag to whether ask for photos authorization by default if needed.
@ -80,11 +79,9 @@ class ScreenshotDetector {
func fail(withError error: Error) {
callback?(nil, error)
}
}
private extension PHAsset {
static func fetchLastScreenshot() -> PHAsset? {
let options = PHFetchOptions()
@ -99,7 +96,6 @@ private extension PHAsset {
}
private extension PHImageRequestOptions {
static var highQualitySyncLocal: PHImageRequestOptions {
let options = PHImageRequestOptions()
options.deliveryMode = .highQualityFormat

View File

@ -24,7 +24,6 @@ private class WeakClientProxyWrapper: ClientDelegate {
}
class ClientProxy: ClientProxyProtocol {
private let client: Client
private let backgroundTaskService: BackgroundTaskServiceProtocol
private var sessionVerificationControllerProxy: SessionVerificationControllerProxy?
@ -71,7 +70,6 @@ class ClientProxy: ClientProxyProtocol {
} catch {
return .failure(.failedRetrievingDisplayName)
}
}
.value
}

View File

@ -10,7 +10,6 @@ import Combine
import MatrixRustSDK
struct MockClientProxy: ClientProxyProtocol {
let callbacks = PassthroughSubject<ClientProxyCallback, Never>()
let userIdentifier: String

View File

@ -10,7 +10,6 @@ import Foundation
import UIKit
struct MockMediaProvider: MediaProviderProtocol {
func imageFromSource(_ source: MediaSource?) -> UIImage? {
nil
}

View File

@ -10,7 +10,6 @@ import Foundation
@MainActor
class MemberDetailProviderManager {
private var memberDetailProviders: [String: MemberDetailProviderProtocol] = [:]
func memberDetailProviderForRoomProxy(_ roomProxy: RoomProxyProtocol) -> MemberDetailProviderProtocol {

View File

@ -9,7 +9,6 @@
import Foundation
struct EventBriefFactory: EventBriefFactoryProtocol {
private let memberDetailProvider: MemberDetailProviderProtocol
init(memberDetailProvider: MemberDetailProviderProtocol) {

View File

@ -10,7 +10,6 @@ import Combine
import Foundation
class MockRoomTimelineController: RoomTimelineControllerProtocol {
let callbacks = PassthroughSubject<RoomTimelineControllerCallback, Never>()
var timelineItems: [RoomTimelineItemProtocol] = [SeparatorRoomTimelineItem(id: UUID().uuidString,

View File

@ -67,7 +67,6 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
_ showSenderDetails: Bool,
_ displayName: String?,
_ avatarImage: UIImage?) -> RoomTimelineItemProtocol {
var aspectRatio: CGFloat?
if let width = message.width,
let height = message.height {

View File

@ -19,7 +19,6 @@ import Kingfisher
import MatrixRustSDK
class UserSessionStore: UserSessionStoreProtocol {
private let keychainController: KeychainControllerProtocol
private let backgroundTaskService: BackgroundTaskServiceProtocol

View File

@ -9,7 +9,6 @@
import SwiftUI
struct UITestsRootView: View {
let mockScreens: [MockScreen]
var selectionCallback: ((UITestScreenIdentifier) -> Void)?

View File

@ -26,7 +26,6 @@ enum TemplateCoordinatorAction {
}
final class TemplateCoordinator: Coordinator, Presentable {
// MARK: - Properties
// MARK: Private

View File

@ -19,7 +19,6 @@ import SwiftUI
typealias TemplateViewModelType = StateStoreViewModel<TemplateViewState, TemplateViewAction>
class TemplateViewModel: TemplateViewModelType, TemplateViewModelProtocol {
// MARK: - Properties
// MARK: Private

View File

@ -17,7 +17,6 @@
import SwiftUI
struct TemplateScreen: View {
// MARK: Private
@Environment(\.colorScheme) private var colorScheme

View File

@ -18,7 +18,6 @@ import ElementX
import XCTest
class BugReportUITests: XCTestCase {
func testInitialStateComponents() {
let app = Application.launch()
app.goToScreenWithIdentifier(.bugReport)
@ -85,7 +84,6 @@ class BugReportUITests: XCTestCase {
XCTAssertEqual(sendButton.label, ElementL10n.actionSend)
XCTAssertFalse(sendButton.isEnabled)
}
}
extension XCUIElement {

View File

@ -19,7 +19,6 @@ import XCTest
@MainActor
class RoomScreenUITests: XCTestCase {
func testPlainNoAvatar() {
let app = Application.launch()
app.goToScreenWithIdentifier(.roomPlainNoAvatar)

View File

@ -19,7 +19,6 @@ import XCTest
@MainActor
class ServerSelectionUITests: XCTestCase {
let textFieldIdentifier = "addressTextField"
func testNormalState() async {

Some files were not shown because too many files have changed in this diff Show More