I am trying to solve an issue with DismissAction in Preview. This is in the View: let parentDismiss: DismissAction
This is what I have in Preview:
struct MilkingView_Previews: PreviewProvider {
static var previews: some View {
MilkingView(parentDismiss: DismissAction())
}
}
But I constantly have an error 'DismissAction' cannot be constructed because it has no accessible initializers
DismissAction() doesn't help as well as DismissAction.
This should be enough to make the preview build, if you simply need to provide a function, but don't need it to actually do anything:
if you do, you can always do something like:
There is no need to do more than this. It is a preview provider showing just part of the UI.