Posts

Showing posts from January, 2017

Functions in Swfit 3.0

As you have seen the previous post on Protocol , NSBlockOperation , Range Operators , Extension . Here you go with the new topic as Function in Swift 3.0.1 with Xcode 8.1. It will include detailed explanation about it. According to Apple’s  Swift Programming Language Book : Methods are functions that are associated with a particular type. Classes, structures, and enumerations can all define instance methods, which encapsulate specific tasks and functionality for working with an instance of a given type. Classes, structures, and enumerations can also define type methods, which are associated with the type itself. Type methods are similar to class methods in Objective-C. Functions A function contains some lines code which performs a specific task. You need to a name function, which explains what it does, call it whenever you need it. Defining and Calling Functions: Defining function -  func wishBday ( person : String ) -> String { let wishes = "