Why should the ColorDetail pop the view, when you are just resetting the selectedView state? To pop you have to dismiss the presented View like so:
struct ColorDetail : View {
//get the presentation mode from the environment:
@Environment(\.presentationMode) var presentation
@Binding var selectedView : Int?
var color : String
var body : some View {
VStack {
Text (color)
Text ("SelectedView: \(selectedView ?? 99)")
Button ("set SelectedView to nil and go back")
{
self.selectedView = nil
//Pop the detail view:
self.presentation.wrappedValue.dismiss()
}
}
}
}
Hope it helps
Klaus
Post
Replies
Boosts
Views
Activity
Note that for iPad OS 14, using key paths will lead to a crash, because the changed control does not have that key path "highlightsToday" anymore:
datePicker.setValue(true, forKeyPath: "highlightsToday")
To the best of my knowledge this will not work, at least I have never managed to pull this off ;-)The layers are composited within the view in the given mode, but the views are then composited just based on the resulting alpha.So, what can you do to achieve what you are trying to do? Basically, you have to work with multple Layers within the same view. CALayers are generally worth diving into, especially CAShapeLayer provides a high performance GPU driven way to draw with shapes.Hope it helpsKlaus
PDFViewScaleChanged is fired when scaling manually at the end of the zoom process. . It is not invoked when changing the zoom i.e. by using a double tap. Seems like a bug to me.