
Here’s a Swifty conundrum for you! First a quick recap. Here’s a simple function with no parameters. Call it and “Hello World” will print to the console. Here’s another function with the same name. This time it has a parameter…
Check out this video tutorial with a lightning tour of functions in Swift. It covers: Parameter default values Optional function parameters Overloading a function If you’re interested in more of these sorts of videos, I’ll be posting frequently over on the…
There are more changes in Swift 3.0 to Optional Function parameters, so I thought I should revisit this blog post. Functions no longer include the name of the first parameter in the function name, and the first parameter is no different…
I was just setting up a class with a designated initializer and a convenience initializer to be able to pass in initializing properties beyond the defaults: Great, all good so far. But sometimes a Font will be instantiated with a…
This post has been updated for Swift 3.0 here. This post has been updated for Swift 3.0 here. There are some changes in Swift 2.0 to Optional Function parameters, so I thought I should revisit this blog post. For info just on…
This post has been updated for Swift 3.0 here. This post has been updated for Swift 3.0 here. Swift has an interesting multi-pronged approach to dealing with default and optional function parameters, based in part on its relationship with Objective C and…
You must be logged in to post a comment.