Post

Replies

Boosts

Views

Activity

Reply to NavigationLinks only work once?
I encountered the same situation when running app in simulator. I found that it is only for simulator with iOS 13.3. Below are my test resultsiPhone 8 simulator with iOS 13.3 --- there is issue: NavigationLink no long work after navigating backiPhone 8 simulator with iOS 13.2.2 --- OKa physical iPhone with iOS 13.3 --- OKluckly seems this is a simulator only issue and it is only for iOS 13.3. I hope it can be fixed in next iOS version.
Dec ’19
Reply to SwiftUI equivalent to viewWillTransition event in UIKit?
A solution is figured out: I don't need to use the viewWillTransition event. Below is the code I wrote:import SwiftUI import GoogleMobileAds import UIKit struct ContentView: View { var body: some View { VStack(alignment: .leading) { AdView().frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 300).border(Color.red, width: 5) } .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) .border(Color.yellow, width: 2) } } struct AdView : UIViewRepresentable { @State private var banner: GADBannerView = GADBannerView(adSize: kGADAdSizeBanner) func makeUIView(context: UIViewRepresentableContext<AdView>) -> GADBannerView { banner.adUnitID = "ca-app-pub-3940256099942544/2934735716" banner.rootViewController = UIApplication.shared.windows.first?.rootViewController banner.load(GADRequest()) return banner } func updateUIView(_ uiView: GADBannerView, context: UIViewRepresentableContext<AdView>) { banner.adSize = kGADAdSizeBanner banner.load(GADRequest()) } }When the device (in simulator) rotates, the AD size changed.
Dec ’19
Reply to How to embed List in ScrollView using SwiftUI
Hi Jim Dovey, You are right. I didn't realize that List can already let me scroll for the content more than one screen. The ForEach solution works for me because it seems to support more than 10 items inside.Thank you!struct ContentView: View { var body: some View { List { ForEach(1 ... 100, id: \.self ) { x in VStack { Text("dfsf") Text("sfsdfj") } } }.padding(10) } }
Dec ’19