I want to have a enum as a parameter of my function. Would this work?
(UIFont*) myMethodName:(UITableViewCellStyle) cellStyle {
//...
if (cellStyle == UITableViewCellStyleValue2)
// ...
}
Then I would call the method like this way
UIFont *resultFont = [self myMethodName:UITableViewCellStyleSubtitle];
Only the following parameters should be allowed:
UITableViewCellStyleDefault,
UITableViewCellStyleValue1,
UITableViewCellStyleValue2,
UITableViewCellStyleSubtitle
Is it possible?
Would this work? → Yes
Only the following parameters should be allowed: → No it is not possible to restrict the input to just these values, i.e.
will still compile (assuming you are not using Objective-C++).