mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
Remove all @available(iOS 14... annotations
This commit is contained in:
@@ -20,7 +20,6 @@ import SwiftUI
|
||||
/**
|
||||
Struct for holding colors for use in SwiftUI.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
public struct ColorSwiftUI: Colors {
|
||||
|
||||
public let accent: Color
|
||||
|
||||
@@ -20,7 +20,6 @@ import SwiftUI
|
||||
/**
|
||||
Struct for holding fonts for use in SwiftUI.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
public struct FontSwiftUI: Fonts {
|
||||
|
||||
public let uiFonts: FontsUIKit
|
||||
|
||||
@@ -30,7 +30,6 @@ import UIKit
|
||||
}
|
||||
|
||||
/// Theme v2 for SwiftUI.
|
||||
@available(iOS 14.0, *)
|
||||
public protocol ThemeSwiftUIType {
|
||||
|
||||
/// Colors object
|
||||
|
||||
@@ -47,6 +47,5 @@ public class DarkColors {
|
||||
)
|
||||
|
||||
public static var uiKit = ColorsUIKit(values: values)
|
||||
@available(iOS 14.0, *)
|
||||
public static var swiftUI = ColorSwiftUI(values: values)
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ public class LightColors {
|
||||
)
|
||||
|
||||
public static var uiKit = ColorsUIKit(values: values)
|
||||
@available(iOS 14.0, *)
|
||||
public static var swiftUI = ColorSwiftUI(values: values)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import Combine
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension Publisher {
|
||||
|
||||
///
|
||||
|
||||
@@ -41,7 +41,6 @@ extension UISIAutoReportData: Codable {
|
||||
|
||||
/// Listens for failed decryption events and silently sends reports RageShake server.
|
||||
/// Also requests that message senders send a matching report to have both sides of the interaction.
|
||||
@available(iOS 14.0, *)
|
||||
@objcMembers class UISIAutoReporter: NSObject, UISIDetectorDelegate {
|
||||
|
||||
struct ReportInfo: Hashable {
|
||||
|
||||
@@ -21,7 +21,6 @@ import SwiftUI
|
||||
UIHostingController that applies some app-level specific configuration
|
||||
(E.g. `vectorContent` modifier and theming to the NavigationController container.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
class VectorHostingController: UIHostingController<AnyView> {
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@@ -114,7 +114,6 @@ final class CreateRoomCoordinator: CreateRoomCoordinatorType {
|
||||
return coordinator
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private func createRoomSelectorCoordinator(parentSpace: MXSpace) -> MatrixItemChooserCoordinator {
|
||||
let paramaters = MatrixItemChooserCoordinatorParameters(session: self.parameters.session, viewProvider: AddRoomSelectorViewProvider(), itemsProcessor: AddRoomItemsProcessor(parentSpace: parentSpace))
|
||||
let coordinator = MatrixItemChooserCoordinator(parameters: paramaters)
|
||||
|
||||
@@ -74,7 +74,6 @@ final class MediaPickerPresenter: NSObject {
|
||||
}
|
||||
|
||||
// MARK: - PHPickerViewControllerDelegate
|
||||
@available(iOS 14, *)
|
||||
extension MediaPickerPresenter: PHPickerViewControllerDelegate {
|
||||
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
|
||||
// TODO: Handle videos and multi-selection
|
||||
|
||||
@@ -260,7 +260,6 @@ final class SideMenuCoordinator: NSObject, SideMenuCoordinatorType {
|
||||
self.spaceDetailPresenter.present(forSpaceWithId: spaceId, from: self.sideMenuViewController, sourceView: sourceView, session: session, animated: true)
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private func showCreateSpace() {
|
||||
guard let session = self.parameters.userSessionsService.mainUserSession?.matrixSession else {
|
||||
return
|
||||
@@ -301,7 +300,6 @@ final class SideMenuCoordinator: NSObject, SideMenuCoordinatorType {
|
||||
self.createRoomCoordinator = createRoomCoordinator
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private func showSpaceSettings(spaceId: String, session: MXSession) {
|
||||
let coordinator = SpaceSettingsModalCoordinator(parameters: SpaceSettingsModalCoordinatorParameters(session: session, spaceId: spaceId, parentSpaceId: nil))
|
||||
coordinator.callback = { [weak self] result in
|
||||
|
||||
@@ -100,7 +100,6 @@ class SpaceMenuPresenter: NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private func showLeaveSpace() {
|
||||
let name = session.spaceService.getSpace(withId: spaceId)?.summary?.displayname ?? VectorL10n.spaceTag
|
||||
|
||||
|
||||
@@ -204,7 +204,6 @@ final class ExploreRoomCoordinator: NSObject, ExploreRoomCoordinatorType {
|
||||
self.navigationRouter.present(coordinator, animated: true)
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private func showSpaceSettings(of childInfo: MXSpaceChildInfo) {
|
||||
let coordinator = SpaceSettingsModalCoordinator(parameters: SpaceSettingsModalCoordinatorParameters(session: session, spaceId: childInfo.childRoomId, parentSpaceId: spaceIdStack.last))
|
||||
coordinator.callback = { [weak self] result in
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
import SwiftUI
|
||||
import Combine
|
||||
|
||||
@available(iOS 14, *)
|
||||
typealias AnalyticsPromptViewModelType = StateStoreViewModel<AnalyticsPromptViewState,
|
||||
Never,
|
||||
AnalyticsPromptViewAction>
|
||||
@available(iOS 14, *)
|
||||
class AnalyticsPromptViewModel: AnalyticsPromptViewModelType {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -31,7 +31,6 @@ final class AnalyticsPromptCoordinator: Coordinator, Presentable {
|
||||
private let analyticsPromptHostingController: UIViewController
|
||||
private var _analyticsPromptViewModel: Any? = nil
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
fileprivate var analyticsPromptViewModel: AnalyticsPromptViewModel {
|
||||
return _analyticsPromptViewModel as! AnalyticsPromptViewModel
|
||||
}
|
||||
@@ -44,7 +43,6 @@ final class AnalyticsPromptCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
init(parameters: AnalyticsPromptCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct AnalyticsPromptStrings: AnalyticsPromptStringsProtocol {
|
||||
let point1 = HTMLFormatter.formatHTML(VectorL10n.analyticsPromptPoint1,
|
||||
withAllowedTags: ["b", "p"],
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAnalyticsPromptScreenState: MockScreenState, CaseIterable {
|
||||
/// The type of prompt to display.
|
||||
case promptType(AnalyticsPromptType)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class AnalyticsPromptUITests: MockScreenTest {
|
||||
|
||||
override class var screenType: MockScreenState.Type {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A prompt that asks the user whether they would like to enable Analytics or not.
|
||||
struct AnalyticsPrompt: View {
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct AnalyticsPromptCheckmarkItem: View {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -75,7 +74,6 @@ struct AnalyticsPromptCheckmarkItem: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct AnalyticsPromptCheckmarkItem_Previews: PreviewProvider {
|
||||
|
||||
static let strings = MockAnalyticsPromptStrings()
|
||||
|
||||
@@ -28,7 +28,6 @@ enum AuthenticationChoosePasswordCoordinatorResult {
|
||||
case cancel
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
final class AuthenticationChoosePasswordCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAuthenticationChoosePasswordScreenState: MockScreenState, CaseIterable {
|
||||
// A case for each state you want to represent
|
||||
// with specific, minimal associated data that will allow you
|
||||
|
||||
@@ -29,7 +29,6 @@ enum AuthenticationForgotPasswordCoordinatorResult {
|
||||
case cancel
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
final class AuthenticationForgotPasswordCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAuthenticationForgotPasswordScreenState: MockScreenState, CaseIterable {
|
||||
// A case for each state you want to represent
|
||||
// with specific, minimal associated data that will allow you
|
||||
|
||||
@@ -49,7 +49,6 @@ enum AuthenticationSoftLogoutCoordinatorResult: CustomStringConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
final class AuthenticationSoftLogoutCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAuthenticationSoftLogoutScreenState: MockScreenState, CaseIterable {
|
||||
// A case for each state you want to represent
|
||||
// with specific, minimal associated data that will allow you
|
||||
|
||||
@@ -21,7 +21,6 @@ struct AuthenticationVerifyEmailCoordinatorParameters {
|
||||
let registrationWizard: RegistrationWizard
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
final class AuthenticationVerifyEmailCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAuthenticationVerifyEmailScreenState: MockScreenState, CaseIterable {
|
||||
// A case for each state you want to represent
|
||||
// with specific, minimal associated data that will allow you
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAuthenticationVerifyMsisdnScreenState: MockScreenState, CaseIterable {
|
||||
// A case for each state you want to represent
|
||||
// with specific, minimal associated data that will allow you
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A visual cue to user that something is in progress.
|
||||
struct ActivityIndicator: View {
|
||||
|
||||
@@ -34,7 +33,6 @@ struct ActivityIndicator: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ActivityIndicator_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A modifier for showing the activity indicator centered over a view.
|
||||
struct ActivityIndicatorModifier: ViewModifier {
|
||||
var show: Bool
|
||||
@@ -36,9 +35,7 @@ struct ActivityIndicatorModifier: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
@available(iOS 14.0, *)
|
||||
func activityIndicator(show: Bool) -> some View {
|
||||
self.modifier(ActivityIndicatorModifier(show: show))
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ class AvatarService: AvatarServiceProtocol {
|
||||
/// - mxContentUri: matrix uri of the avatar to fetch
|
||||
/// - avatarSize: The size of avatar to retrieve as defined in the DesignKit spec.
|
||||
/// - Returns: A Future of UIImage that returns an error if it fails to fetch the image.
|
||||
@available(iOS 14.0, *)
|
||||
func avatarImage(mxContentUri: String, avatarSize: AvatarSize) -> Future<UIImage, Error> {
|
||||
|
||||
let cachePath = MXMediaManager.thumbnailCachePath(
|
||||
|
||||
@@ -19,7 +19,6 @@ import Combine
|
||||
import DesignKit
|
||||
import UIKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class MockAvatarService: AvatarServiceProtocol {
|
||||
static let example: AvatarServiceProtocol = MockAvatarService()
|
||||
func avatarImage(mxContentUri: String, avatarSize: AvatarSize) -> Future<UIImage, Error> {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct AvatarImage: View {
|
||||
|
||||
@Environment(\.theme) var theme: ThemeSwiftUI
|
||||
@@ -57,7 +56,6 @@ struct AvatarImage: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension AvatarImage {
|
||||
init(avatarData: AvatarInputProtocol, size: AvatarSize) {
|
||||
self.init(
|
||||
@@ -69,7 +67,6 @@ extension AvatarImage {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension AvatarImage {
|
||||
func border(color: Color) -> some View {
|
||||
modifier(BorderModifier(color: color, borderWidth: 3, shape: Circle()))
|
||||
@@ -82,7 +79,6 @@ extension AvatarImage {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct AvatarImage_Previews: PreviewProvider {
|
||||
static let mxContentUri = "fakeUri"
|
||||
static let name = "Alice"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A reusable view that will show a standard placeholder avatar with the
|
||||
/// supplied character and colour index for the `namesAndAvatars` color array.
|
||||
///
|
||||
@@ -50,7 +49,6 @@ struct PlaceholderAvatarImage: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct Previews_TemplateAvatarImage_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
PlaceholderAvatarImage(firstCharacter: "X", colorIndex: 1)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct SpaceAvatarImage: View {
|
||||
|
||||
@Environment(\.theme) var theme: ThemeSwiftUI
|
||||
@@ -73,7 +72,6 @@ struct SpaceAvatarImage: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension SpaceAvatarImage {
|
||||
init(avatarData: AvatarInputProtocol, size: AvatarSize) {
|
||||
self.init(
|
||||
@@ -85,7 +83,6 @@ extension SpaceAvatarImage {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LiveAvatarImage_Previews: PreviewProvider {
|
||||
static let mxContentUri = "fakeUri"
|
||||
static let name = "Alice"
|
||||
|
||||
@@ -22,6 +22,5 @@ import UIKit
|
||||
|
||||
/// Provides a simple api to retrieve and cache avatar images
|
||||
protocol AvatarServiceProtocol {
|
||||
@available(iOS 14.0, *)
|
||||
func avatarImage(mxContentUri: String, avatarSize: AvatarSize) -> Future<UIImage, Error>
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import Combine
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// Simple ViewModel that supports loading an avatar image
|
||||
class AvatarViewModel: InjectableObject, ObservableObject {
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
/// A Modifier to be called from the top-most SwiftUI view before being added to a HostViewController.
|
||||
///
|
||||
/// Provides any app level configuration the SwiftUI hierarchy might need (E.g. to monitor theme changes).
|
||||
@available(iOS 14.0, *)
|
||||
struct VectorContentModifier: ViewModifier {
|
||||
|
||||
@ObservedObject private var themePublisher = ThemePublisher.shared
|
||||
@@ -38,7 +37,6 @@ struct VectorContentModifier: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
func vectorContent() -> some View {
|
||||
self.modifier(VectorContentModifier())
|
||||
|
||||
@@ -25,7 +25,6 @@ private struct DependencyContainerKey: EnvironmentKey {
|
||||
static let defaultValue = DependencyContainer()
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension EnvironmentValues {
|
||||
var dependencies: DependencyContainer {
|
||||
get { self[DependencyContainerKey.self] }
|
||||
@@ -33,7 +32,6 @@ extension EnvironmentValues {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
|
||||
/// A modifier for adding a dependency to the SwiftUI view hierarchy's dependency container.
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SceneKit
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class EffectsScene: SCNScene {
|
||||
|
||||
// MARK: - Constants
|
||||
@@ -61,7 +60,6 @@ class EffectsScene: SCNScene {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
fileprivate extension Color {
|
||||
/// The color's components as an array of floats in the extended linear sRGB colorspace.
|
||||
///
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
import SceneKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A SwiftUI wrapper around `SCNView`, that unlike `SceneView` allows the
|
||||
/// scene to have a transparent background and be rendered on top of other views.
|
||||
struct EffectsView: UIViewRepresentable {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import Combine
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension Publisher where Failure == Never {
|
||||
/// Same as `assign(to:on:)` but maintains a weak reference to object
|
||||
///
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
|
||||
/// The static list of mocked screens in RiotSwiftUI
|
||||
@available(iOS 14.0, *)
|
||||
enum MockAppScreens {
|
||||
static let appScreens: [MockScreenState.Type] = [
|
||||
MockLiveLocationSharingViewerScreenState.self,
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Used for mocking top level screens and their various states.
|
||||
@available(iOS 14.0, *)
|
||||
protocol MockScreenState {
|
||||
static var screenStates: [MockScreenState] { get }
|
||||
var screenType: Any.Type { get }
|
||||
var screenView: ([Any], AnyView) { get }
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension MockScreenState {
|
||||
|
||||
/// Get a list of the screens for every screen state.
|
||||
@@ -60,7 +58,6 @@ extension MockScreenState {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension MockScreenState where Self: CaseIterable {
|
||||
static var screenStates: [MockScreenState] {
|
||||
return Array(self.allCases)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ScreenList: View {
|
||||
|
||||
private var allStates: [ScreenStateInfo]
|
||||
@@ -49,7 +48,6 @@ struct ScreenList: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ScreenList_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ScreenList(screens: [MockTemplateUserProfileScreenState.self])
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ScreenStateInfo {
|
||||
var dependencies: [Any]
|
||||
var view: AnyView
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class StateRenderer {
|
||||
var states: [ScreenStateInfo]
|
||||
init(states: [ScreenStateInfo]) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import RiotSwiftUI
|
||||
/// Creates a test case for each screen state, launches the app,
|
||||
/// goes to the correct screen and provides the state and key for each
|
||||
/// invocation of the test.
|
||||
@available(iOS 14.0, *)
|
||||
class MockScreenTest: XCTestCase {
|
||||
|
||||
enum Constants {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import XCTest
|
||||
import Combine
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension XCTestCase {
|
||||
/// XCTest utility to wait for results from publishers, so that the output can be used for assertions.
|
||||
///
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension ThemeIdentifier {
|
||||
fileprivate static let defaultTheme = DefaultThemeSwiftUI()
|
||||
fileprivate static let darkTheme = DarkThemeSwiftUI()
|
||||
|
||||
@@ -18,12 +18,10 @@ import Foundation
|
||||
import SwiftUI
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private struct ThemeKey: EnvironmentKey {
|
||||
static let defaultValue = ThemePublisher.shared.theme
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension EnvironmentValues {
|
||||
var theme: ThemeSwiftUI {
|
||||
get { self[ThemeKey.self] }
|
||||
@@ -31,7 +29,6 @@ extension EnvironmentValues {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
/// A theme modifier for setting the theme for this view and all its descendants in the hierarchy.
|
||||
/// - Parameter theme: A theme to be set as the environment value.
|
||||
@@ -41,7 +38,6 @@ extension View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
/// A theme modifier for setting the theme by id for this view and all its descendants in the hierarchy.
|
||||
/// - Parameter themeId: ThemeIdentifier of a theme to be set as the environment value.
|
||||
|
||||
@@ -21,7 +21,6 @@ import Combine
|
||||
///
|
||||
/// Replaces the old ThemeObserver. Riot app can push updates to this class
|
||||
/// removing the dependency of this class on the `ThemeService`.
|
||||
@available(iOS 14.0, *)
|
||||
class ThemePublisher: ObservableObject {
|
||||
|
||||
private static var _shared: ThemePublisher? = nil
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
protocol ThemeSwiftUI: ThemeSwiftUIType {
|
||||
var identifier: ThemeIdentifier { get }
|
||||
var isDark: Bool { get }
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension ThemeSwiftUI {
|
||||
|
||||
/// Get the stable display user color based on userId.
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct DarkThemeSwiftUI: ThemeSwiftUI {
|
||||
var identifier: ThemeIdentifier = .dark
|
||||
let isDark: Bool = true
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import DesignKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct DefaultThemeSwiftUI: ThemeSwiftUI {
|
||||
var identifier: ThemeIdentifier = .light
|
||||
let isDark: Bool = false
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct BorderModifier<Shape: InsettableShape>: ViewModifier {
|
||||
|
||||
var color: Color
|
||||
@@ -29,7 +28,6 @@ struct BorderModifier<Shape: InsettableShape>: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
func shapedBorder<Shape: InsettableShape>(color: Color, borderWidth: CGFloat, shape: Shape) -> some View {
|
||||
modifier(BorderModifier(color: color, borderWidth: borderWidth, shape: shape))
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import SwiftUI
|
||||
import Introspect
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A bordered style of text input
|
||||
///
|
||||
/// As defined in:
|
||||
@@ -90,7 +89,6 @@ struct BorderedInputFieldStyle: TextFieldStyle {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct BorderedInputFieldStyle_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -78,7 +78,6 @@ struct InlineTextButton: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct Previews_InlineButtonText_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
InlineTextButton("Hello there this is a sentence. %@.",
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct MultilineTextField: View {
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
@@ -92,7 +91,6 @@ struct MultilineTextField: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
fileprivate struct UITextViewWrapper: UIViewRepresentable {
|
||||
typealias UIViewType = UITextView
|
||||
|
||||
@@ -172,7 +170,6 @@ fileprivate struct UITextViewWrapper: UIViewRepresentable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct MultilineTextField_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct OptionButton: View {
|
||||
|
||||
// MARK: - Style
|
||||
@@ -70,7 +69,6 @@ struct OptionButton: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct OptionButton_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct PrimaryActionButtonStyle: ButtonStyle {
|
||||
@Environment(\.theme) private var theme
|
||||
@Environment(\.isEnabled) private var isEnabled
|
||||
@@ -48,7 +47,6 @@ struct PrimaryActionButtonStyle: ButtonStyle {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct PrimaryActionButtonStyle_Previews: PreviewProvider {
|
||||
static var buttons: some View {
|
||||
Group {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct RadioButton: View {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -51,7 +50,6 @@ struct RadioButton: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct RadioButton_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct RoundedBorderTextEditor: View {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -100,7 +99,6 @@ struct RoundedBorderTextEditor: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ThemableTextEditor_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct RoundedCornerShape: Shape {
|
||||
|
||||
let radius: CGFloat
|
||||
|
||||
@@ -21,7 +21,6 @@ import SwiftUI
|
||||
https://stackoverflow.com/q/65375372
|
||||
Replace with Swift 5.5 bindings enumerator later.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
struct SafeBindingCollectionEnumerator<T: RandomAccessCollection & MutableCollection, C: View>: View {
|
||||
|
||||
typealias BoundElement = Binding<T.Element>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// `ScreenTrackerViewModifier` is a helper class used to track PostHog screen from SwiftUI screens.
|
||||
struct ScreenTrackerViewModifier: ViewModifier {
|
||||
let screen: AnalyticsScreen
|
||||
@@ -32,7 +31,6 @@ struct ScreenTrackerViewModifier: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
func track(screen: AnalyticsScreen) -> some View {
|
||||
return self.modifier(ScreenTrackerViewModifier(screen: screen))
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct SearchBar: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct SecondaryActionButtonStyle: ButtonStyle {
|
||||
@Environment(\.theme) private var theme
|
||||
@Environment(\.isEnabled) private var isEnabled
|
||||
@@ -41,7 +40,6 @@ struct SecondaryActionButtonStyle: ButtonStyle {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct SecondaryActionButtonStyle_Previews: PreviewProvider {
|
||||
static var theme: ThemeSwiftUI = DefaultThemeSwiftUI()
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@ struct StyledText: View {
|
||||
}
|
||||
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct StyledText_Previews: PreviewProvider {
|
||||
static func prettyText() -> NSAttributedString {
|
||||
let string = NSMutableAttributedString(string: "T", attributes: [
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ThemableButton: View {
|
||||
|
||||
// MARK: - Style
|
||||
@@ -64,7 +63,6 @@ struct ThemableButton: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ThemableButton_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ThemableNavigationBar: View {
|
||||
|
||||
// MARK: - Style
|
||||
@@ -65,7 +64,6 @@ struct ThemableNavigationBar: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct NavigationBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct ThemableTextEditor: UIViewRepresentable {
|
||||
|
||||
// MARK: Properties
|
||||
@@ -128,7 +127,6 @@ struct ThemableTextEditor: UIViewRepresentable {
|
||||
|
||||
// MARK: - modifiers
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension ThemableTextEditor {
|
||||
func keyboardType(_ type: UIKeyboardType) -> ThemableTextEditor {
|
||||
textView.keyboardType = type
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
/// A modifier for showing the wait overlay view over a view.
|
||||
struct WaitOverlayModifier: ViewModifier {
|
||||
|
||||
@@ -34,16 +33,13 @@ struct WaitOverlayModifier: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
@available(iOS 14.0, *)
|
||||
func waitOverlay(show: Bool, message: String? = nil, allowUserInteraction: Bool = true) -> some View {
|
||||
self.modifier(WaitOverlayModifier(allowUserInteraction: allowUserInteraction, show: show, message: message))
|
||||
}
|
||||
}
|
||||
|
||||
/// `WaitOverlay` allows to easily add an overlay that covers the entire with an `ActivityIndicator` at the center
|
||||
@available(iOS 14.0, *)
|
||||
struct WaitOverlay: ViewModifier {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -103,7 +99,6 @@ struct WaitOverlay: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct WaitOverlay_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
/// A SwiftUI `PreferenceKey` for `CGRect` values such as a view's frame.
|
||||
@available(iOS 14.0, *)
|
||||
struct FramePreferenceKey: PreferenceKey {
|
||||
static var defaultValue: CGRect = .zero
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import SwiftUI
|
||||
/// SomeView()
|
||||
/// .background(ViewFrameReader(frame: $frame))
|
||||
/// ```
|
||||
@available(iOS 14.0, *)
|
||||
struct ViewFrameReader: View {
|
||||
@Binding var frame: CGRect
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ import Combine
|
||||
/// A similar approach is taken in libraries like [CombineFeedback](https://github.com/sergdort/CombineFeedback).
|
||||
/// It provides a nice layer of consistency and also safety. As we are not passing the `ViewModel` to the view directly, shortcuts/hacks
|
||||
/// can't be made into the `ViewModel`.
|
||||
@available(iOS 14, *)
|
||||
@dynamicMemberLookup
|
||||
class ViewModelContext<ViewState:BindableState, ViewAction>: ObservableObject {
|
||||
// MARK: - Properties
|
||||
@@ -75,7 +74,6 @@ class ViewModelContext<ViewState:BindableState, ViewAction>: ObservableObject {
|
||||
/// a specific portion of state that can be safely bound to.
|
||||
/// If we decide to add more features to our state management (like doing state processing off the main thread)
|
||||
/// we can do it in this centralised place.
|
||||
@available(iOS 14, *)
|
||||
class StateStoreViewModel<State: BindableState, StateAction, ViewAction> {
|
||||
|
||||
typealias Context = ViewModelContext<State, ViewAction>
|
||||
|
||||
@@ -35,7 +35,6 @@ struct OnboardingIconImage: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct OnboardingIconImage_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
OnboardingIconImage(image: Asset.Images.authenticationEmailIcon)
|
||||
|
||||
@@ -44,7 +44,6 @@ final class LiveLocationSharingViewerCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
init(parameters: LiveLocationSharingViewerCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ enum LiveLocationSharingViewerViewModelResult {
|
||||
|
||||
// MARK: View
|
||||
|
||||
@available(iOS 14, *)
|
||||
struct LiveLocationSharingViewerViewState: BindableState {
|
||||
|
||||
/// Map style URL
|
||||
|
||||
@@ -18,11 +18,9 @@ import SwiftUI
|
||||
import Combine
|
||||
import Mapbox
|
||||
|
||||
@available(iOS 14, *)
|
||||
typealias LiveLocationSharingViewerViewModelType = StateStoreViewModel<LiveLocationSharingViewerViewState,
|
||||
Never,
|
||||
LiveLocationSharingViewerViewAction>
|
||||
@available(iOS 14, *)
|
||||
class LiveLocationSharingViewerViewModel: LiveLocationSharingViewerViewModelType, LiveLocationSharingViewerViewModelProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -19,6 +19,5 @@ import Foundation
|
||||
protocol LiveLocationSharingViewerViewModelProtocol {
|
||||
|
||||
var completion: ((LiveLocationSharingViewerViewModelResult) -> Void)? { get set }
|
||||
@available(iOS 14, *)
|
||||
var context: LiveLocationSharingViewerViewModelType.Context { get }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import SwiftUI
|
||||
|
||||
/// Using an enum for the screen allows you define the different state cases with
|
||||
/// the relevant associated data for each case.
|
||||
@available(iOS 14.0, *)
|
||||
enum MockLiveLocationSharingViewerScreenState: MockScreenState, CaseIterable {
|
||||
// A case for each state you want to represent
|
||||
// with specific, minimal associated data that will allow you
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import Combine
|
||||
import CoreLocation
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
protocol LiveLocationSharingViewerServiceProtocol {
|
||||
|
||||
/// All shared users live location
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import CoreLocation
|
||||
import MatrixSDK
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LiveLocationSharingViewerService: LiveLocationSharingViewerServiceProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import Combine
|
||||
import CoreLocation
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class MockLiveLocationSharingViewerService: LiveLocationSharingViewerServiceProtocol {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LiveLocationSharingViewerUITests: MockScreenTest {
|
||||
|
||||
override class var screenType: MockScreenState.Type {
|
||||
|
||||
@@ -19,7 +19,6 @@ import Combine
|
||||
|
||||
@testable import RiotSwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LiveLocationSharingViewerViewModelTests: XCTestCase {
|
||||
|
||||
var service: MockLiveLocationSharingViewerService!
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LiveLocationListItem: View {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -121,7 +120,6 @@ struct LiveLocationListItem: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LiveLocationListPreview: View {
|
||||
|
||||
let liveLocationSharingViewerService: LiveLocationSharingViewerServiceProtocol = MockLiveLocationSharingViewerService()
|
||||
@@ -181,7 +179,6 @@ struct LiveLocationListPreview: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LiveLocationListItem_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
Group {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
import DSBottomSheet
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LiveLocationSharingViewer: View {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -90,7 +89,6 @@ struct LiveLocationSharingViewer: View {
|
||||
}
|
||||
|
||||
// MARK: - Bottom sheet
|
||||
@available(iOS 14.0, *)
|
||||
extension LiveLocationSharingViewer {
|
||||
|
||||
var sheetStyle: BottomSheetStyle {
|
||||
@@ -119,7 +117,6 @@ extension LiveLocationSharingViewer {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LiveLocationSharingViewer_Previews: PreviewProvider {
|
||||
static let stateRenderer = MockLiveLocationSharingViewerScreenState.stateRenderer
|
||||
static var previews: some View {
|
||||
|
||||
@@ -73,7 +73,6 @@ final class LocationSharingCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
init(parameters: LocationSharingCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ enum LocationSharingViewError {
|
||||
case failedSharingLocation
|
||||
}
|
||||
|
||||
@available(iOS 14, *)
|
||||
struct LocationSharingViewState: BindableState {
|
||||
|
||||
/// Map style URL
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import SwiftUI
|
||||
import CoreLocation
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
enum MockLocationSharingScreenState: MockScreenState, CaseIterable {
|
||||
case shareUserLocation
|
||||
|
||||
|
||||
@@ -18,11 +18,9 @@ import SwiftUI
|
||||
import Combine
|
||||
import CoreLocation
|
||||
|
||||
@available(iOS 14, *)
|
||||
typealias LocationSharingViewModelType = StateStoreViewModel<LocationSharingViewState,
|
||||
Never,
|
||||
LocationSharingViewAction>
|
||||
@available(iOS 14, *)
|
||||
class LocationSharingViewModel: LocationSharingViewModelType, LocationSharingViewModelProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -18,7 +18,6 @@ import Foundation
|
||||
import Combine
|
||||
import CoreLocation
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class MockLocationSharingService: LocationSharingServiceProtocol {
|
||||
func requestAuthorization(_ handler: @escaping LocationAuthorizationHandler) {
|
||||
handler(.authorizedAlways)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LocationSharingUITests: XCTestCase {
|
||||
|
||||
private var app: XCUIApplication!
|
||||
|
||||
@@ -20,7 +20,6 @@ import CoreLocation
|
||||
|
||||
@testable import RiotSwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LocationSharingViewModelTests: XCTestCase {
|
||||
|
||||
var cancellables = Set<AnyCancellable>()
|
||||
|
||||
@@ -18,7 +18,6 @@ import SwiftUI
|
||||
import Combine
|
||||
import Mapbox
|
||||
|
||||
@available(iOS 14, *)
|
||||
struct LocationSharingMapView: UIViewRepresentable {
|
||||
|
||||
// MARK: - Constants
|
||||
@@ -109,7 +108,6 @@ struct LocationSharingMapView: UIViewRepresentable {
|
||||
}
|
||||
|
||||
// MARK: - Coordinator
|
||||
@available(iOS 14, *)
|
||||
extension LocationSharingMapView {
|
||||
|
||||
class Coordinator: NSObject, MGLMapViewDelegate, UIGestureRecognizerDelegate {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LocationSharingMarkerView<Content: View>: View {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -45,7 +44,6 @@ struct LocationSharingMarkerView<Content: View>: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LocationSharingUserMarkerView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let avatarData = AvatarInput(mxContentUri: "",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user