You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling didSelect (and other callbacks) twice overrides the previous callback without warning.
Say a user wants to do some logic in their model and some logic for view state in their SwiftUI view this won't work:
PageView(...){// ...}.didSelect(model.didSelectPage).didSelect(updateViewState(forSelectedPage:))// Only the last one is called
but instead they have to put both calls in one didSelect.
This is not a big problem but calls to onAppear which are similar in API can be called multiple times so users might expect that.
I think there should either be an assert to check if didSelect (or a different callback) was previously set and let the user know that this won't work OR append the new closures to the previous one.
The text was updated successfully, but these errors were encountered:
Parchment/Parchment/Structs/PageView.swift
Line 87 in c9268f4
Calling didSelect (and other callbacks) twice overrides the previous callback without warning.
Say a user wants to do some logic in their model and some logic for view state in their SwiftUI view this won't work:
but instead they have to put both calls in one didSelect.
This is not a big problem but calls to
onAppear
which are similar in API can be called multiple times so users might expect that.I think there should either be an assert to check if didSelect (or a different callback) was previously set and let the user know that this won't work OR append the new closures to the previous one.
The text was updated successfully, but these errors were encountered: