• Waqar Malik


A subroutine is a block of code that performs a specific task. Another name for a subroutine is a function. You’ve already seen global functions, such as print. Methods are functions that are associated with a particular type. In Swift, methods can be associated with classes, structures, and enumeration types. There are two types of methods: instance methods and type methods.


Specific Task Type Method Implementation Detail Global Function Specific Instance 

Copyright information

© Waqar Malik 2015

Authors and Affiliations

  • Waqar Malik
    • 1
  1. 1.CAUS

Personalised recommendations