|
|
|
|
|
by jurip
3312 days ago
|
|
You can argue if it's useful or not on its own, but it makes sense when you consider that Swift is compatible with Objective-C. In Objective-C, that function would be a method like -(void) greetWith:(NSString *)greeting to:(NSString *)personName
and you'd call it like [self greetWith:@"Hello" to:@"Bob"]
Swift's external/internal parameters are built to allow the same style as was used with Objective-C and easy bridging. Swift's APIs tend to be terser than Objective-C ones, though. |
|