swiftui

How to pass uiviewcontroller data to swiftui widget class

萝らか妹 提交于 2021-01-07 01:36:12
问题 How to pass uiviewcontroller data to swiftui widget class i am unable to do it with app groups also write now i am sending it with userdefaults but unable to do it if let userDefaults = UserDefaults(suiteName: "group.com.soup.ios.app") { UserDefaults.standard.set(self.dat ?? "", forKey: "date") UserDefaults.standard.set(self.textData.text ?? "", forKey: "text") } if let userDefaults = UserDefaults(suiteName: "group.com.soup.ios.app") { let text = UserDefaults.standard.object(forKey: "text")

How to remove opacity animation in SwiftUI NavigationLink

烂漫一生 提交于 2021-01-06 04:48:25
问题 When tapping on a NavigationLink, it reduces the opacity slightly. Is there a way to disable this. I tried using .buttonStyle(PlainButtonStyle()) but that didn't have the desired effect. It is embedded in a scrollView (preferred over List for customizability): ScrollView { ForEach(items){ item in NavigationLink(destination: DetailView()){ HStack{ Text("title") Spacer() Image(systemName: "chevron.right") } .padding() .background( RoundedRectangle(cornerRadius: 10, style: continuous)

SwiftUI: Translucent background for fullScreenCover

别等时光非礼了梦想. 提交于 2021-01-05 19:35:12
问题 So technically I want to show a loading screen view. I'm using fullScreenCover . struct ContentView: View { @State private var isLoading = false var body: some View { VStack { Text("Hello there") Button("Start loading") { isLoading.toggle() } .fullScreenCover(isPresented: $isLoading) { ZStack{ Color.black.opacity(0.5).edgesIgnoringSafeArea(.all) VStack { ProgressView() Button("Stop loading") { isLoading.toggle() } } } } } } } The problem is that I cannot make this loading screen translucent.

SwiftUI: Translucent background for fullScreenCover

随声附和 提交于 2021-01-05 19:02:06
问题 So technically I want to show a loading screen view. I'm using fullScreenCover . struct ContentView: View { @State private var isLoading = false var body: some View { VStack { Text("Hello there") Button("Start loading") { isLoading.toggle() } .fullScreenCover(isPresented: $isLoading) { ZStack{ Color.black.opacity(0.5).edgesIgnoringSafeArea(.all) VStack { ProgressView() Button("Stop loading") { isLoading.toggle() } } } } } } } The problem is that I cannot make this loading screen translucent.

SwiftUI: Translucent background for fullScreenCover

半城伤御伤魂 提交于 2021-01-05 19:01:03
问题 So technically I want to show a loading screen view. I'm using fullScreenCover . struct ContentView: View { @State private var isLoading = false var body: some View { VStack { Text("Hello there") Button("Start loading") { isLoading.toggle() } .fullScreenCover(isPresented: $isLoading) { ZStack{ Color.black.opacity(0.5).edgesIgnoringSafeArea(.all) VStack { ProgressView() Button("Stop loading") { isLoading.toggle() } } } } } } } The problem is that I cannot make this loading screen translucent.

SwiftUI: Translucent background for fullScreenCover

♀尐吖头ヾ 提交于 2021-01-05 18:56:46
问题 So technically I want to show a loading screen view. I'm using fullScreenCover . struct ContentView: View { @State private var isLoading = false var body: some View { VStack { Text("Hello there") Button("Start loading") { isLoading.toggle() } .fullScreenCover(isPresented: $isLoading) { ZStack{ Color.black.opacity(0.5).edgesIgnoringSafeArea(.all) VStack { ProgressView() Button("Stop loading") { isLoading.toggle() } } } } } } } The problem is that I cannot make this loading screen translucent.

SwiftUI: Translucent background for fullScreenCover

为君一笑 提交于 2021-01-05 18:52:32
问题 So technically I want to show a loading screen view. I'm using fullScreenCover . struct ContentView: View { @State private var isLoading = false var body: some View { VStack { Text("Hello there") Button("Start loading") { isLoading.toggle() } .fullScreenCover(isPresented: $isLoading) { ZStack{ Color.black.opacity(0.5).edgesIgnoringSafeArea(.all) VStack { ProgressView() Button("Stop loading") { isLoading.toggle() } } } } } } } The problem is that I cannot make this loading screen translucent.

SwiftUI: Translucent background for fullScreenCover

陌路散爱 提交于 2021-01-05 18:51:47
问题 So technically I want to show a loading screen view. I'm using fullScreenCover . struct ContentView: View { @State private var isLoading = false var body: some View { VStack { Text("Hello there") Button("Start loading") { isLoading.toggle() } .fullScreenCover(isPresented: $isLoading) { ZStack{ Color.black.opacity(0.5).edgesIgnoringSafeArea(.all) VStack { ProgressView() Button("Stop loading") { isLoading.toggle() } } } } } } } The problem is that I cannot make this loading screen translucent.

How to make exponents in the SwiftUI

浪尽此生 提交于 2021-01-05 13:01:25
问题 I found the new method in SwiftUI to allow you to create an exponent. Here what I write code is based in SwiftUI on the Swift Playground. import SwiftUI import PlaygroundSupport struct V: View { var body: some View { HStack { Text("8") Text("2\n").font(Font.system(size: 10)) } } } PlaygroundPage.current.setLiveView(V()) The \n allows you to break the line and make a new line in UIKit. However, SwiftUI gives you to make a top while break line and make a new line inside the second Text. You can

How to make exponents in the SwiftUI

南楼画角 提交于 2021-01-05 13:00:35
问题 I found the new method in SwiftUI to allow you to create an exponent. Here what I write code is based in SwiftUI on the Swift Playground. import SwiftUI import PlaygroundSupport struct V: View { var body: some View { HStack { Text("8") Text("2\n").font(Font.system(size: 10)) } } } PlaygroundPage.current.setLiveView(V()) The \n allows you to break the line and make a new line in UIKit. However, SwiftUI gives you to make a top while break line and make a new line inside the second Text. You can