Objective-C Parameter Names Unneeded in Headers
In an Objective-C "@interface" the names for parameter variables don't really matter. In fact, they can all be exactly the same name, and different from the "@implementation", which is useful in header files.
Method names are almost always descriptive enough. If parameter names are identical, there's less to maintain; I like using a single underscore "_" for all header-file parameters.
Here's an example of a method that has lots of parameters, where the parameter names are kind of pointless:
@interface UIView : . . .
+ (void)
transitionWithView:(UIView *) view
duration:(NSTimeInterval) duration
options:(UIViewAnimationOptions) options
animations:(void (^)(void)) animations
completion:(void (^)(BOOL finished)) completion;
They could actually have just said this (changing all names to "_"): @interface UIView : . . .
+ (void)
transitionWithView:(UIView *)_
duration:(NSTimeInterval)_
options:(UIViewAnimationOptions)_
animations:(void (^)(void))_
completion:(void (^)(BOOL finished))_;
3 comments
[ 4.5 ms ] story [ 17.9 ms ] threadSlightly related, I'd argue that "animations" is very poorly chosen. A plural noun indicates a set or collection of objects, whereas this is a block pointer to be used for... something...
As for the name, this is Apple's method name from UIView so ask them. :)