mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add template to xcodegen, fix build and tests
This commit is contained in:
committed by
Stefan Ceriu
parent
4b728f3d09
commit
2f6015b97b
@@ -38,7 +38,6 @@ final class RoomScreenCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
init(parameters: RoomScreenCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ struct MessageComposerTextField: View {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private struct UITextViewWrapper: UIViewRepresentable {
|
||||
typealias UIViewType = UITextView
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class UITestsAppCoordinator: Coordinator {
|
||||
window.rootViewController = mainNavigationController
|
||||
|
||||
let screens = mockScreens()
|
||||
let rootView = UITestsRootView(mockCoordinators: screens) { id in
|
||||
let rootView = UITestsRootView(mockScreens: screens) { id in
|
||||
guard let screen = screens.filter({ $0.id == id }).first else {
|
||||
fatalError()
|
||||
}
|
||||
@@ -36,12 +36,14 @@ class UITestsAppCoordinator: Coordinator {
|
||||
window.makeKeyAndVisible()
|
||||
}
|
||||
|
||||
private func mockScreens() -> [MockScreens] {
|
||||
[MockScreens(id: "Login screen", coordinator: LoginScreenCoordinator(parameters: .init()))]
|
||||
private func mockScreens() -> [MockScreen] {
|
||||
[MockScreen(id: "Login screen", coordinator: LoginScreenCoordinator(parameters: .init())),
|
||||
MockScreen(id: "Simple Screen - Regular", coordinator: TemplateSimpleScreenCoordinator(parameters: .init(promptType: .regular))),
|
||||
MockScreen(id: "Simple Screen - Upgrade", coordinator: TemplateSimpleScreenCoordinator(parameters: .init(promptType: .upgrade)))]
|
||||
}
|
||||
}
|
||||
|
||||
struct MockScreens: Identifiable {
|
||||
struct MockScreen: Identifiable {
|
||||
let id: String
|
||||
let coordinator: Presentable
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@ import SwiftUI
|
||||
|
||||
struct UITestsRootView: View {
|
||||
|
||||
let mockCoordinators: [MockScreens]
|
||||
let mockScreens: [MockScreen]
|
||||
var selectionCallback: ((String) -> Void)?
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List(mockCoordinators) { coordinator in
|
||||
List(mockScreens) { coordinator in
|
||||
Button(coordinator.id) {
|
||||
selectionCallback?(coordinator.id)
|
||||
}
|
||||
|
||||
@@ -88,3 +88,4 @@ targets:
|
||||
- Screens/Templates
|
||||
- path: ../Resources
|
||||
- path: ../SupportingFiles
|
||||
- path: ../../Tools/Scripts/Templates/SimpleScreenExample/ElementX
|
||||
|
||||
Reference in New Issue
Block a user