Swift functions


  Translation results:

Swift is an open source programming language that supports multiple programming paradigms and compiled. It was released by Apple at WWDC (Apple Developer Conference) in 2014 and is used to develop iOS, OS X and watchOS applications.

Swift combines the best of C and Objective-C without the limitations of C compatibility.

Swift can use the same running environment as Objective-C on Mac OS and iOS platforms.

Swift functionssyntax

Swift functions are independent blocks of code used to accomplish specific tasks.

Swift uses a unified syntax to represent simple C-style functions to complex Objective-C style methods.

Function declaration: tells the compiler the name, return type and parameters of the function.

Function definition: Provides the entity of the function.

Swift functionsexample

func funcname(形参) -> returntype{
   Statement1
   Statement2
   ……
   Statement N   
   return parameters
   }

Popular Recommendations

Home

Videos

Q&A