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
When a function takes a parameter that isn't named in the function name, should it be given an external name?
For example, when using this function:
extensionUIView{func zoom(scale:CGFloat){
// the zooming
}}
...the call would look like myView.zoom(2.3). My question is should it be made more clear with an externally named parameter and you'd say myView.zoom(toScale: 2.3)?
Or maybe even myView.zoomToScale(2.3) --- I think this is bad and not very swifty here, but in some cases it would work better. As it does in presentViewController()
And can we use this kind of function naming rule universally?
The text was updated successfully, but these errors were encountered:
This has relevance here, notably the Strive for Fluent Usage section. I think we should seek parity w/ the official design guidelines where possible. I don't see anything concrete one way or the other here, just a general principle.
When a function takes a parameter that isn't named in the function name, should it be given an external name?
For example, when using this function:
...the call would look like
myView.zoom(2.3)
. My question is should it be made more clear with an externally named parameter and you'd saymyView.zoom(toScale: 2.3)
?Or maybe even
myView.zoomToScale(2.3)
--- I think this is bad and not very swifty here, but in some cases it would work better. As it does inpresentViewController()
And can we use this kind of function naming rule universally?
The text was updated successfully, but these errors were encountered: