swiftui

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 !

tvOS Textfield Transparent Background

北城以北 提交于 2021-01-05 07:08:47
问题 I am working on a tvOS project. I use swift and siwftUI, and I want to create a TextField with a transparent background. The thing is when I set the background color to transparent, there is still a layer of highlight and when you navigate and focus is on the text field it expands. I tried many things but I was not able to solve it. Then I decided to go with the background color but this layer is still there and I cannot get rid of it. As you can see in the picture, that layer is visible in

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 !

How to remove bottom/top item padding from SwiftUI List in Mac OS

蓝咒 提交于 2021-01-05 07:07:47
问题 I am having a hard time removing all padding from my cells in MacOS using SwiftUI. I can't seem to be able to do it even in Apple's Code! https://developer.apple.com/tutorials/swiftui/creating-a-macos-app For example, inside the LandMarkList of the MacLandmarks folder in Xcode, I have put a .listRowInsets(EdgeInsets()) at the end of the forEach so that the code looks like this: struct LandmarkList: View { @EnvironmentObject private var userData: UserData @Binding var selectedLandmark:

tvOS Textfield Transparent Background

孤人 提交于 2021-01-05 07:07:41
问题 I am working on a tvOS project. I use swift and siwftUI, and I want to create a TextField with a transparent background. The thing is when I set the background color to transparent, there is still a layer of highlight and when you navigate and focus is on the text field it expands. I tried many things but I was not able to solve it. Then I decided to go with the background color but this layer is still there and I cannot get rid of it. As you can see in the picture, that layer is visible in

Why does the size animate and not the text with this SwiftUI view?

◇◆丶佛笑我妖孽 提交于 2021-01-05 07:07:08
问题 Why does the size animate and not the text with this SwiftUI view? The Text correctly gets bigger and smaller, but the value of the text does not change. struct ContentView: View { @State private var isAnimating = 0 var foreverAnimation: Animation { Animation.linear(duration: 1) .repeatForever() } var body: some View { Text(isAnimating > 5 ? "Hello" : "Byebye") .scaleEffect(isAnimating > 5 ? 1.5 : 1) .animation(foreverAnimation) .onAppear { self.isAnimating = 10 } } } 来源: https:/

tvOS Textfield Transparent Background

℡╲_俬逩灬. 提交于 2021-01-05 07:07:08
问题 I am working on a tvOS project. I use swift and siwftUI, and I want to create a TextField with a transparent background. The thing is when I set the background color to transparent, there is still a layer of highlight and when you navigate and focus is on the text field it expands. I tried many things but I was not able to solve it. Then I decided to go with the background color but this layer is still there and I cannot get rid of it. As you can see in the picture, that layer is visible in

How do I communicate between a SwiftUI view to another when a coordinator is involved?

时光毁灭记忆、已成空白 提交于 2021-01-05 07:05:13
问题 I am new to SwiftUI. Just a few days trying to learn. I have tried to find a tutorial on this but I was not successfull. Imagine I have the following view: Struct MyPicker: View { MyPicker is inside a VStack inside ContentView . I have to pass, from MyPicker to ContentView , 3 parameters: color , width and type . The problem is that these values come from a delegate callback inside MyPicker . So I have to have a coordinator inside MyPicker . struct MyPickerHelper: UIViewRepresentable { class

How do I communicate between a SwiftUI view to another when a coordinator is involved?

左心房为你撑大大i 提交于 2021-01-05 07:05:11
问题 I am new to SwiftUI. Just a few days trying to learn. I have tried to find a tutorial on this but I was not successfull. Imagine I have the following view: Struct MyPicker: View { MyPicker is inside a VStack inside ContentView . I have to pass, from MyPicker to ContentView , 3 parameters: color , width and type . The problem is that these values come from a delegate callback inside MyPicker . So I have to have a coordinator inside MyPicker . struct MyPickerHelper: UIViewRepresentable { class

SwiftUI Form not positioning correctly using Spacer()

自作多情 提交于 2021-01-05 06:58:19
问题 I am trying to create a profile page, in which there is a form at the bottom with various options. However when I insert a Spacer( ) into the VStack , the form does not move to the bottom of the screen, as it should do. I tried replacing the Form with a Text and it worked fine, moving to the bottom of the screen. So I'm assuming it has something to do with the form. Here is my code struct Profile: View { @Environment(\.presentationMode) var mode: Binding<PresentationMode> var body: some View