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
It is rare in SwiftUI for a modifier to take a binding because rarely do modifiers need to modify the passed in value. In the case of some of these (all of them?), the value cannot be modified, so it doesn't make any sense for the biding to take a binding. For example, isGeoViewNavigating(:). In those cases, the type of the parameter should be changed to the value type of the binding itself._
The modifiers in question, queryCenter, geoViewExtent, and isGeoViewNavigating all take bindings and should be considered for changing away from binding to the value type.
One thing to consider is whether any of those values should be passed as an initializer parameter rather than through a modifier. Are they part of the view's data, do they make up part of the definition of what a search view is? Does a user always need to specify any of those values? If so, an initializer parameter makes more sense. But if it is just configuring the view, something that doesn't need to be done, then a modifier makes sense.
From a Samples PR review...
It is rare in SwiftUI for a modifier to take a binding because rarely do modifiers need to modify the passed in value. In the case of some of these (all of them?), the value cannot be modified, so it doesn't make any sense for the biding to take a binding. For example, isGeoViewNavigating(:). In those cases, the type of the parameter should be changed to the value type of the binding itself._
The modifiers in question,
queryCenter
,geoViewExtent
, andisGeoViewNavigating
all take bindings and should be considered for changing away from binding to the value type.The text was updated successfully, but these errors were encountered: