
- 在Package.swift中更新依赖路径,确保项目结构清晰。 - 在AppSettingFeature中新增初始化方法,支持用户信息、头像和昵称的设置。 - 更新FeedListFeature和MainFeature,新增测试按钮和导航功能,提升用户交互体验。 - 在MeFeature中优化用户信息加载逻辑,增强错误处理能力。 - 新增TestView以支持测试功能,验证导航跳转的有效性。 - 更新多个视图以整合新功能,提升代码可读性与维护性。
34 lines
724 B
Swift
34 lines
724 B
Swift
import SwiftUI
|
|
import ComposableArchitecture
|
|
|
|
struct AppRootView: View {
|
|
@State private var isLoggedIn = false
|
|
|
|
var body: some View {
|
|
if isLoggedIn {
|
|
MainView(
|
|
store: Store(
|
|
initialState: MainFeature.State()
|
|
) {
|
|
MainFeature()
|
|
}
|
|
)
|
|
} else {
|
|
LoginView(
|
|
store: Store(
|
|
initialState: LoginFeature.State()
|
|
) {
|
|
LoginFeature()
|
|
},
|
|
onLoginSuccess: {
|
|
isLoggedIn = true
|
|
}
|
|
)
|
|
}
|
|
}
|
|
}
|
|
//
|
|
//#Preview {
|
|
// AppRootView()
|
|
//}
|