Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class ___VARIABLE_flowCoordinatorIdentifier___FlowCoordinator: NavigationS

extension ___VARIABLE_flowCoordinatorIdentifier___FlowCoordinator {
@EnumIdentable
enum Destination: Hashable, Identifiable {
enum Destination {
case destination
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ protocol ___VARIABLE_sceneIdentifier___ComponentModelProtocol: ComponentModel {

final class ___VARIABLE_sceneIdentifier___ComponentModel: ___VARIABLE_sceneIdentifier___ComponentModelProtocol {

let onEvent: (Event) -> Void
let onEvent: @MainActor (Event) -> Void

private let dataCache: DataCache<DataCacheModel>
private let resource: ___VARIABLE_sceneIdentifier___Resource
Expand Down Expand Up @@ -38,7 +38,7 @@ extension ___VARIABLE_sceneIdentifier___ComponentModel {
final class ___VARIABLE_sceneIdentifier___ComponentModelMock: ___VARIABLE_sceneIdentifier___ComponentModelProtocol {
typealias Event = ___VARIABLE_sceneIdentifier___ComponentModel.Event

var onEvent: (Event) -> Void = { _ in }
var onEvent: @MainActor (Event) -> Void = { _ in }

func onAppear() async {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ protocol ___VARIABLE_sceneIdentifier___ComponentModelProtocol: ComponentModel {

final class ___VARIABLE_sceneIdentifier___ComponentModel: ___VARIABLE_sceneIdentifier___ComponentModelProtocol {

let onEvent: (Event) -> Void
let onEvent: @MainActor (Event) -> Void

private let dataCache: DataCache<DataCacheModel>

Expand All @@ -35,7 +35,7 @@ extension ___VARIABLE_sceneIdentifier___ComponentModel {
final class ___VARIABLE_sceneIdentifier___ComponentModelMock: ___VARIABLE_sceneIdentifier___ComponentModelProtocol {
typealias Event = ___VARIABLE_sceneIdentifier___ComponentModel.Event

var onEvent: (Event) -> Void = { _ in }
var onEvent: @MainActor (Event) -> Void = { _ in }

func onAppear() async {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SwiftUI
final class ___VARIABLE_sceneFlowProviderIdentifier___SceneFlowProvider: CoordinatorSceneFlowProvider {
let navigateTo: (Destination) -> Void
let pop: () -> Void
let present: ((Destination, ModalCoverModel<Destination>.Style) -> Void)? = nil
let present: ((Destination, ModalCoverModelStyle) -> Void)? = nil
let dismissModal: (() -> Void)? = nil
let onModalDismiss: (() -> Void)? = nil
let popTo: ((Destination?) -> Void)? = nil
Expand Down Expand Up @@ -39,7 +39,7 @@ final class ___VARIABLE_sceneFlowProviderIdentifier___SceneFlowProvider: Coordin

extension ___VARIABLE_sceneFlowProviderIdentifier___SceneFlowProvider {
@EnumIdentable
enum Destination: Hashable, Identifiable {
enum Destination {
case someDestination
case otherDestination
// Uncomment 'end' case if the coordinator may present additional scenes following those defined by the flow provider.
Expand Down
1 change: 1 addition & 0 deletions Templates/SwiftUI App.xctemplate/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ final class AppCoordinator: ObservableObject {
self.container = container
}

@MainActor
var rootView: some View {
ExampleFlowCoordinator.rootView(
with: ExampleFlowCoordinator(container: container)
Expand Down
6 changes: 3 additions & 3 deletions Templates/SwiftUI App.xctemplate/ExampleComponentModel.swift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Priamo v final class ExampleComponentModel nechceme mať tiež tú anotáciu pri funkcii (func onTouchUpInside()) ? 🤔

Compiler to asi nevyžaduje takže iba či to tam chceme explicitne pridávať či nie.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jojo za mě chceme, přidal jsem to tam

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import FuturedArchitecture

protocol ExampleComponentModelProtocol: ComponentModel {
func onAppear() async
func onTouchUpInside()
@MainActor func onTouchUpInside()
}

final class ExampleComponentModel: ExampleComponentModelProtocol {

let onEvent: (Event) -> Void
let onEvent: @MainActor (Event) -> Void

private let dataCache: DataCache<DataCacheModel>

Expand Down Expand Up @@ -41,7 +41,7 @@ extension ExampleComponentModel {
final class ExampleComponentModelMock: ExampleComponentModelProtocol {
typealias Event = ExampleComponentModel.Event

var onEvent: (Event) -> Void = { _ in }
var onEvent: @MainActor (Event) -> Void = { _ in }

func onAppear() async { }

Expand Down
5 changes: 3 additions & 2 deletions Templates/SwiftUI App.xctemplate/ExampleFlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ final class ExampleFlowCoordinator: NavigationStackCoordinator {
self.container = container
}

@MainActor
static func rootView(with instance: ExampleFlowCoordinator) -> some View {
NavigationStackFlow(coordinator: instance) {
ExampleComponent(
Expand All @@ -28,7 +29,7 @@ final class ExampleFlowCoordinator: NavigationStackCoordinator {
}
}

@ViewBuilder
@MainActor @ViewBuilder
func scene(for destination: Destination) -> some View {
switch destination {
case .destination:
Expand All @@ -39,7 +40,7 @@ final class ExampleFlowCoordinator: NavigationStackCoordinator {

extension ExampleFlowCoordinator {
@EnumIdentable
enum Destination: Hashable, Identifiable {
enum Destination {
case destination
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ final class ___VARIABLE_tabCoordinatorIdentifier___TabCoordinator: TabCoordinato
@Published var selectedTab: Tab
@Published var modalCover: ModalCoverModel<Destination>?

@MainActor
init(container: Container, selectedTab: Tab) {
self.container = container
self.selectedTab = selectedTab
Expand Down Expand Up @@ -47,7 +48,7 @@ final class ___VARIABLE_tabCoordinatorIdentifier___TabCoordinator: TabCoordinato

extension ___VARIABLE_tabCoordinatorIdentifier___TabCoordinator {
@EnumIdentable
enum Destination: Hashable, Identifiable {
enum Destination {
case destination
}
}
Loading