Designated Initializers and Convenience Initializers in Swift
Does that look a bit familiar? If you’ve been following the blog for a while it should, that is the initializer for our Message class used in the previous articles Classes In Swift — An Introduction and Using a Nested Type in Swift. That syntax is to create a designated initializer. Our Message class only had one initializer, so it had to be the designated one. To create a designated initializer, it is just the init keyword, with the parameters afterwards, and then the code inside the curly braces.