
- 在.gitignore中添加忽略项以排除不必要的文件。 - 删除架构分析需求文档以简化项目文档。 - 在APIEndpoints.swift和LoginModels.swift中移除调试信息的异步调用,提升代码简洁性。 - 在EMailLoginFeature.swift和HomeFeature.swift中新增登录流程状态管理,优化用户体验。 - 在多个视图中调整状态管理和导航逻辑,确保一致性和可维护性。 - 更新Xcode项目配置以增强调试信息的输出格式。
36 lines
801 B
Swift
36 lines
801 B
Swift
import SwiftUI
|
|
import ComposableArchitecture
|
|
|
|
struct AppRootView: View {
|
|
@State private var isLoggedIn = false
|
|
|
|
var body: some View {
|
|
if isLoggedIn {
|
|
HomeView(
|
|
store: Store(
|
|
initialState: HomeFeature.State()
|
|
) {
|
|
HomeFeature()
|
|
},
|
|
onLogout: {
|
|
isLoggedIn = false
|
|
}
|
|
)
|
|
} else {
|
|
LoginView(
|
|
store: Store(
|
|
initialState: LoginFeature.State()
|
|
) {
|
|
LoginFeature()
|
|
},
|
|
onLoginSuccess: {
|
|
isLoggedIn = true
|
|
}
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
AppRootView()
|
|
} |