Variadic parameters allow a series of parameters of a variable number of values to be passed into a function. Transforming Objective-C code into equivalent Swift code may be done with the following language features.
Last active
August 15, 2018 06:46
-
-
Save brennanMKE/a65e41fb2caa639aeeb3d49e6885f191 to your computer and use it in GitHub Desktop.
VariadicParameter in Objective-C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)log:(nonnull NSString *)format, ... { | |
va_list args; | |
va_start(args, format); | |
NSString *message = [[NSString alloc] initWithFormat:format arguments:args]; | |
va_end(args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment