12

example function

func example(titles: [String]) `->` [UIButton] {

}

and where could i find more docs on this topic (docs relevant to functions declaring in swift)?

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Bob
  • 2,263
  • 5
  • 21
  • 30

2 Answers2

25

There is no > in swift function declarations - someone botched up the HTML rendering in the page you were reading. It was supposed to be -> (an arrow made up of a hypen and the greater than operator) that's used to denote the return type of the function.

The text was supposed to read

func example(titles: [String]) -> [UIButton] {

}

Which means the example function has one parameter called titles of type [String] (array of String) and it returns a [UIButton] (array of UIButton).

lchamp
  • 6,592
  • 2
  • 19
  • 27
Mureinik
  • 297,002
  • 52
  • 306
  • 350
3

Assuming you're talking about -> the portion after that denotes the return value of the function.

rounak
  • 9,217
  • 3
  • 42
  • 59