diff --git a/Podfile b/Podfile index eead8ee05..185514efd 100644 --- a/Podfile +++ b/Podfile @@ -16,9 +16,9 @@ use_frameworks! # - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixSDKVersion = '= 0.24.0' +# $matrixSDKVersion = '= 0.24.0' # $matrixSDKVersion = :local -# $matrixSDKVersion = { :branch => 'develop'} +$matrixSDKVersion = { :branch => 'develop'} # $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } } ######################################## diff --git a/Podfile.lock b/Podfile.lock index e9ddd85c5..b2b93eb21 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -121,8 +121,8 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.24.0) - - MatrixSDK/JingleCallStack (= 0.24.0) + - MatrixSDK (from `https://github.com/matrix-org/matrix-ios-sdk.git`, branch `develop`) + - MatrixSDK/JingleCallStack (from `https://github.com/matrix-org/matrix-ios-sdk.git`, branch `develop`) - OLMKit - PostHog (~> 1.4.4) - ReadMoreTextView (~> 3.0.1) @@ -163,7 +163,6 @@ SPEC REPOS: - libPhoneNumber-iOS - LoggerAPI - Logging - - MatrixSDK - MatrixSDKCrypto - OLMKit - PostHog @@ -187,11 +186,17 @@ EXTERNAL SOURCES: AnalyticsEvents: :branch: release/swift :git: https://github.com/matrix-org/matrix-analytics-events.git + MatrixSDK: + :branch: develop + :git: https://github.com/matrix-org/matrix-ios-sdk.git CHECKOUT OPTIONS: AnalyticsEvents: :commit: 53ad46ba1ea1ee8f21139dda3c351890846a202f :git: https://github.com/matrix-org/matrix-analytics-events.git + MatrixSDK: + :commit: 66aefba83a80dbc6ee2ed799b7e6a539ec315eca + :git: https://github.com/matrix-org/matrix-ios-sdk.git SPEC CHECKSUMS: AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce @@ -237,6 +242,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: c6ddab0a8561cf3d4f870aab1073b2a320c2c8dd +PODFILE CHECKSUM: 56887a1da36d198cd845aa7bffe244cf837bc866 COCOAPODS: 1.11.3 diff --git a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme index 012a5a109..e1775adc4 100644 --- a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme +++ b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme @@ -1,11 +1,10 @@ + version = "1.3"> + buildImplicitDependencies = "YES"> @@ -35,11 +34,20 @@ + + + + @@ -52,17 +60,6 @@ - - - - - - - - - - diff --git a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListBridgePresenter.swift b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListBridgePresenter.swift index fd442e47e..41b79334d 100644 --- a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListBridgePresenter.swift +++ b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListBridgePresenter.swift @@ -27,12 +27,12 @@ import Foundation /// (mainly for integration in legacy view controllers). Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. @objcMembers final class ComposerCreateActionListBridgePresenter: NSObject { - // MARK: - Constants // MARK: - Properties // MARK: Private + private let actions: [ComposerCreateAction] private var coordinator: ComposerCreateActionListCoordinator? @@ -43,7 +43,9 @@ final class ComposerCreateActionListBridgePresenter: NSObject { // MARK: - Setup init(actions: [Int]) { - self.actions = actions.compactMap({ ComposerCreateAction(rawValue: $0) }) + self.actions = actions.compactMap { + ComposerCreateAction(rawValue: $0) + } super.init() } @@ -55,7 +57,6 @@ final class ComposerCreateActionListBridgePresenter: NSObject { // } func present(from viewController: UIViewController, animated: Bool) { - let composerCreateActionListCoordinator = ComposerCreateActionListCoordinator(actions: actions) composerCreateActionListCoordinator.callback = { [weak self] action in guard let self = self else { return } @@ -70,11 +71,11 @@ final class ComposerCreateActionListBridgePresenter: NSObject { viewController.present(presentable, animated: animated, completion: nil) composerCreateActionListCoordinator.start() - self.coordinator = composerCreateActionListCoordinator + coordinator = composerCreateActionListCoordinator } func dismiss(animated: Bool, completion: (() -> Void)?) { - guard let coordinator = self.coordinator else { + guard let coordinator = coordinator else { return } // Dismiss modal diff --git a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListCoordinator.swift b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListCoordinator.swift index e07d5f2a0..a9057c26d 100644 --- a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListCoordinator.swift +++ b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Coordinator/ComposerCreateActionListCoordinator.swift @@ -23,10 +23,10 @@ enum ComposerCreateActionListCoordinatorAction { } final class ComposerCreateActionListCoordinator: NSObject, Coordinator, Presentable, UISheetPresentationControllerDelegate { - // MARK: - Properties // MARK: Private + private let hostingController: UIViewController private var view: ComposerCreateActionList private var viewModel: ComposerCreateActionListViewModel @@ -41,7 +41,7 @@ final class ComposerCreateActionListCoordinator: NSObject, Coordinator, Presenta init(actions: [ComposerCreateAction]) { viewModel = ComposerCreateActionListViewModel(initialViewState: ComposerCreateActionListViewState(actions: actions)) - self.view = ComposerCreateActionList(viewModel: viewModel.context) + view = ComposerCreateActionList(viewModel: viewModel.context) let hostingVC = VectorHostingController(rootView: view) hostingVC.bottomSheetPreferences = VectorHostingBottomSheetPreferences(detents: [.medium]) hostingController = hostingVC @@ -62,10 +62,10 @@ final class ComposerCreateActionListCoordinator: NSObject, Coordinator, Presenta } func toPresentable() -> UIViewController { - return self.hostingController + hostingController } func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { - self.callback?(.cancel) - } + callback?(.cancel) + } } diff --git a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Model/ComposerCreateActionListModels.swift b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Model/ComposerCreateActionListModels.swift index cf6cff1e3..1d822257b 100644 --- a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Model/ComposerCreateActionListModels.swift +++ b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/Model/ComposerCreateActionListModels.swift @@ -1,4 +1,4 @@ -// +// // Copyright 2022 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,6 @@ enum ComposerCreateActionListViewModelResult: Equatable { // MARK: View struct ComposerCreateActionListViewState: BindableState { - /// The list of composer create actions to display to the user let actions: [ComposerCreateAction] } diff --git a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/View/ComposerCreateActionList.swift b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/View/ComposerCreateActionList.swift index e514482fd..4de4dc3b3 100644 --- a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/View/ComposerCreateActionList.swift +++ b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/View/ComposerCreateActionList.swift @@ -1,4 +1,4 @@ -// +// // Copyright 2022 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,7 +17,6 @@ import SwiftUI struct ComposerCreateActionList: View { - // MARK: - Properties // MARK: Private diff --git a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListVIewModelProtocol.swift b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListVIewModelProtocol.swift index 6e11fc0e2..8eaa3dacc 100644 --- a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListVIewModelProtocol.swift +++ b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListVIewModelProtocol.swift @@ -1,4 +1,4 @@ -// +// // Copyright 2022 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListViewModel.swift b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListViewModel.swift index 43fc70eeb..bd063b1b2 100644 --- a/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListViewModel.swift +++ b/RiotSwiftUI/Modules/Room/Composer/CreateActionList/ViewModel/ComposerCreateActionListViewModel.swift @@ -19,7 +19,6 @@ import SwiftUI typealias ComposerCreateActionListViewModelType = StateStoreViewModel class ComposerCreateActionListViewModel: ComposerCreateActionListViewModelType, ComposerCreateActionListViewModelProtocol { - // MARK: - Properties // MARK: Private diff --git a/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift b/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift index 109ab5de2..32d627cd3 100644 --- a/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift +++ b/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift @@ -1,4 +1,4 @@ -// +// // Copyright 2022 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,7 +22,6 @@ import WysiwygComposer /// An item in the toolbar struct FormatItem { - /// The type of the item let type: FormatType /// Whether it is active(highlighted) @@ -48,7 +47,6 @@ extension FormatItem: Identifiable { } extension FormatItem { - /// The icon for the item var icon: String { switch type { diff --git a/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift b/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift index c8596a9d2..f74e939f1 100644 --- a/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift +++ b/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift @@ -19,11 +19,11 @@ import SwiftUI import WysiwygComposer struct Composer: View { - // MARK: - Properties // MARK: Private + @State var focused = false private let borderHeight: CGFloat = 44 private let minTextViewHeight: CGFloat = 20 private var verticalPadding: CGFloat { @@ -85,6 +85,11 @@ struct Composer: View { .padding(.horizontal, 12) .padding(.top, 8) .padding(.bottom, 4) + .onTapGesture { + if !focused { + focused = true + } + } HStack { Button { showSendMediaActions() @@ -131,6 +136,7 @@ struct Composer: View { } // MARK: Previews + struct Composer_Previews: PreviewProvider { static let stateRenderer = MockComposerScreenState.stateRenderer static var previews: some View { diff --git a/RiotSwiftUI/Modules/Room/Composer/View/FormattingToolbar.swift b/RiotSwiftUI/Modules/Room/Composer/View/FormattingToolbar.swift index 8a8cfeaa4..aeacb0108 100644 --- a/RiotSwiftUI/Modules/Room/Composer/View/FormattingToolbar.swift +++ b/RiotSwiftUI/Modules/Room/Composer/View/FormattingToolbar.swift @@ -1,4 +1,4 @@ -// +// // Copyright 2022 New Vector Ltd // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,8 +18,6 @@ import SwiftUI import WysiwygComposer struct FormattingToolbar: View { - - // MARK: - Properties // MARK: Private @@ -31,25 +29,24 @@ struct FormattingToolbar: View { /// The list of items to render in the toolbar var formatItems: [FormatItem] /// The action when an item is selected - var formatAction: (FormatType) -> () + var formatAction: (FormatType) -> Void var body: some View { HStack { - ForEach(formatItems) { item in - Button { - formatAction(item.type) - } label: { - Image(item.icon) - .renderingMode(.template) - .foregroundColor(item.active ? theme.colors.accent : theme.colors.tertiaryContent) - } - .disabled(item.disabled) - .background(item.active ? theme.colors.accent.opacity(0.1) : theme.colors.background) - .cornerRadius(8) - .accessibilityIdentifier(item.accessibilityIdentifier) - } - - } + ForEach(formatItems) { item in + Button { + formatAction(item.type) + } label: { + Image(item.icon) + .renderingMode(.template) + .foregroundColor(item.active ? theme.colors.accent : theme.colors.tertiaryContent) + } + .disabled(item.disabled) + .background(item.active ? theme.colors.accent.opacity(0.1) : theme.colors.background) + .cornerRadius(8) + .accessibilityIdentifier(item.accessibilityIdentifier) + } + } } }