Learn Swift Fundamentals by preparing for Job Interview, Questions 33~ 35 For Functions

The concepts I’m going to introduce now make your code more elegant. Be sure to read and understand.

33) What is variadic number of params method?

Answer:

  • A method which accepts dynamic number of input arguments is known as variadic params method
variadic number of input arguments

34) How to set default value to a method input arguments?

Answer:

  • func myName(firstName: String, lastName=”Shin”)
Default Parameter Value

35) Is Swift Function Value Type or Reference Type ?

Answer:

  • It’s Reference Type

--

--

KD Knowledge Diet

Software Engineer, Mobile Developer living in Seoul. I hate people using difficult words. Why not using simple words? Keep It Simple Stupid!