onappear

Why i don't see my animation when user is logged in?

ⅰ亾dé卋堺 提交于 2021-01-05 07:08:55
问题 I created a custom LaunchSreen which works well when the user is not logged in but if he is logged in we do not see the animation (the view goes right to the Home view and doesn't wait for the animation to be completed). Do you have any idea why? import SwiftUI struct LaunchScreen: View { @EnvironmentObject var session: SessionStore @State private var animationDone = false @State private var rotation = 0.0 func getUser () { session.listen() } var body: some View { Group{ if (session.session !

Why i don't see my animation when user is logged in?

房东的猫 提交于 2021-01-05 07:08:29
问题 I created a custom LaunchSreen which works well when the user is not logged in but if he is logged in we do not see the animation (the view goes right to the Home view and doesn't wait for the animation to be completed). Do you have any idea why? import SwiftUI struct LaunchScreen: View { @EnvironmentObject var session: SessionStore @State private var animationDone = false @State private var rotation = 0.0 func getUser () { session.listen() } var body: some View { Group{ if (session.session !

SwifUI onAppear gets called twice

别等时光非礼了梦想. 提交于 2020-12-08 06:54:16
问题 Q1: Why are onAppears called twice? Q2: Alternatively, where can I make my network call? I have placed onAppears at a few different place in my code and they are all called twice. Ultimately, I'm trying to make a network call before displaying the next view so if you know of a way to do that without using onAppear, I'm all ears. I have also tried to place and remove a ForEach inside my Lists and it doesn't change anything. Xcode 12 Beta 3 -> Target iOs 14 CoreData enabled but not used yet

SwifUI onAppear gets called twice

孤人 提交于 2020-12-08 06:53:08
问题 Q1: Why are onAppears called twice? Q2: Alternatively, where can I make my network call? I have placed onAppears at a few different place in my code and they are all called twice. Ultimately, I'm trying to make a network call before displaying the next view so if you know of a way to do that without using onAppear, I'm all ears. I have also tried to place and remove a ForEach inside my Lists and it doesn't change anything. Xcode 12 Beta 3 -> Target iOs 14 CoreData enabled but not used yet