Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Swift のコードをフォーマット #69

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions app/ios/Modules/Sources/Auth/ComposeLoginScreen.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import SwiftUI
import KmpContainer
import NitoCombined
import SwiftUI
import UIKit

public struct ComposeLoginScreen: UIViewControllerRepresentable {
private let onLoginSuccess: () -> Void
Expand Down
18 changes: 10 additions & 8 deletions app/ios/Modules/Sources/Auth/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,20 @@ public struct LoginView: View {
.onAppear {
Task { await stateMachine.load() }
}
.onReceive(stateMachine.$event, perform: { event in
switch event {
case .some(.onLoginSuccess):
onLoginSuccess()
default: break
}
})
.onReceive(
stateMachine.$event,
perform: { event in
switch event {
case .some(.onLoginSuccess):
onLoginSuccess()
default: break
}
})
}
}

#Preview {
LoginView(
onLoginSuccess: { }
onLoginSuccess: {}
)
}
2 changes: 1 addition & 1 deletion app/ios/Modules/Sources/Navigation/RootStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RootStateMachine: ObservableObject {
path.append(routing)
}
}

func load() async {
state.authStatus = .loading

Expand Down
14 changes: 7 additions & 7 deletions app/ios/Modules/Sources/Navigation/RootView.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Auth
import Common
import NitoCombined
import Schedule
import Settings
import SwiftUI
import Top
import NitoCombined

public struct RootView: View {
@StateObject var stateMachine: RootStateMachine = .init()
Expand All @@ -17,25 +17,25 @@ public struct RootView: View {
.navigationDestination(for: Routing.self) { routing in
switch routing {
case .login:
ComposeLoginScreen(
ComposeLoginScreen(
onLoginSuccess: {
stateMachine.dispatch(intent: .routing(.top))
}
)
.navigationBarBackButtonHidden(true)
.ignoresSafeArea(.keyboard)
.navigationBarBackButtonHidden(true)
.ignoresSafeArea(.keyboard)
case .top:
ComposeTopScreen(
ComposeTopScreen(
onScheduleListButtonClick: {
stateMachine.dispatch(intent: .routing(.scheduleList))
},
onSettingsButtonClick: {
stateMachine.dispatch(intent: .routing(.settings))
}
)
.navigationBarBackButtonHidden(true)
.navigationBarBackButtonHidden(true)
case .scheduleList:
ComposeScheduleListScreen()
ComposeScheduleListScreen()
case .settings:
ComposeSettingsScreen()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import UIKit
import SwiftUI
import KmpContainer
import NitoCombined
import SwiftUI
import UIKit

public struct ComposeScheduleListScreen: UIViewControllerRepresentable {
public init() {}

public func makeUIViewController(context: Context) -> UIViewController {
return ScheduleListScreen_iosKt.ScheduleListRouteViewController(
viewModel: ScheduleListViewModel(
getParticipantScheduleListUseCase: Container.shared.get(type: GetParticipantScheduleListUseCase.self),
getParticipantScheduleListUseCase: Container.shared.get(
type: GetParticipantScheduleListUseCase.self),
userMessageStateHolder: Container.shared.get(type: UserMessageStateHolder.self),
dateTimeFormatter: Container.shared.get(type: CommonNitoDateTimeFormatter.self)
)
Expand Down
4 changes: 2 additions & 2 deletions app/ios/Modules/Sources/Settings/ComposeSettingsScreen.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import SwiftUI
import KmpContainer
import NitoCombined
import SwiftUI
import UIKit

public struct ComposeSettingsScreen: UIViewControllerRepresentable {
@StateObject var stateMachine: SettingsStateMachine = .init()
Expand Down
6 changes: 3 additions & 3 deletions app/ios/Modules/Sources/Top/ComposeTopScreen.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import UIKit
import SwiftUI
import KmpContainer
import NitoCombined
import SwiftUI
import UIKit

public struct ComposeTopScreen: UIViewControllerRepresentable {
private let onScheduleListButtonClick: () -> Void
private let onSettingsButtonClick: () -> Void

public init(
onScheduleListButtonClick: @escaping () -> Void,
onSettingsButtonClick: @escaping () -> Void
Expand Down
6 changes: 3 additions & 3 deletions app/ios/Modules/Sources/Top/TopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public struct TopView: View {

private let onScheduleListButtonClick: () -> Void
private let onSettingsButtonClick: () -> Void

public init(
onScheduleListButtonClick: @escaping () -> Void,
onSettingsButtonClick: @escaping () -> Void
Expand Down Expand Up @@ -66,7 +66,7 @@ public struct TopView: View {

#Preview {
TopView(
onScheduleListButtonClick: { },
onSettingsButtonClick: { }
onScheduleListButtonClick: {},
onSettingsButtonClick: {}
)
}