Sometimes (well most of the time) presented sheet gets dismissed first time it is opened. This is happening only on a device and only the first time the app is launched. This is the code:
struct ContentView: View {
	
		var body: some View {
			
				NavigationView {
						NavigationLink(destination: DetailsView()) {
								Text("Open Details View")
						}
				}
				.navigationViewStyle(StackNavigationViewStyle())
		}
}
struct DetailsView: View {
	
		@State var sheetIsPresented: Bool = false
	
		var body: some View {
				VStack {
						Button("Open") {
								sheetIsPresented.toggle()
						}
				}.sheet(isPresented: $sheetIsPresented, content: {
						SheetView()
				})
		}
}
struct SheetView: View {
	
		var body: some View {
				Color.red
		}
}
I was able to fix this problem by removing line .navigationViewStyle(StackNavigationViewStyle()), but I need StackNavigationViewStyle in my project. Any help will be appreciated.
Post
Replies
Boosts
Views
Activity
Code:
struct ContentView: View {
		var body: some View {
				ScrollView {
						Text(Date(), style: .timer)
				}
		}
}
Produces crash:
Thread 1: EXC_BREAKPOINT
in:
DisplayList.ViewUpdater.ViewCache.setNextUpdate(_:item:state:tag:) ()
Any recommendations/workarounds?
Why setting .navigationViewStyle(StackNavigationViewStyle())breaks ColorPicker? This is happening only on a device (works on simulator).
Run the app (tested on device running iOS 14.0 and 14.0.0)
Navigate to child view
Press on color picker button (color sheet will be presented)
Try to select any color(-s). onChange is not triggered and state is not being updated. If you dismiss color picker and select color picker again then everything will be working.
If you remove setting navigationViewStyle, everything is working as expected.
struct ContentView: View {
		var body: some View {
				NavigationView {
						NavigationLink("Open Child", destination: ChildView())
				}
				.navigationViewStyle(StackNavigationViewStyle())
		}
}
struct ChildView: View {
		
		@State private var selectedCustomColor = Color.purple
		
		var body: some View {
				VStack {
						ColorPicker("", selection: $selectedCustomColor)
						Spacer()
				}
				.background(selectedCustomColor)
				.onChange(of: selectedCustomColor, perform: { value in
						print("on change")
				})
		}
}
I am trying to use StoreKitTest to simulate .failed transaction in my unit tests. For the test session I set:
testSession.failTransactionsEnabled = true
testSession.failureError = SKError.Code.unknown
after that I call:
testSession.buyProduct(productIdentifier: productIdentifier)
I assumed that
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
delegate method should be called with transactionState failed. Unfortunately the delegate method is not called, any ideas why?
I was able to simulate purchased transaction using StoreKitTest. I am using Xcode Version 12.0 beta 6.
Is it possible at this moment (using iOS beta 3, Xcode beta 3) to distribute app that has widget extension using Ad hoc distribution? I am able to run the app with a widget directly on a device using debug configuration but as soon as I archive and distribute it using Ad hoc the widget is not showing up in the widget gallery. Though the app is running fine. Any help would be appreciated.