0

This is my array for function

var funcArray = Array<() -> Void>()

To the array I append closure functions which comes as a parameter

func someFunc(completition: (() -> Void)?){
// ...
     if let callback = completition {
         funcArray.append(callback)
     }
// ...
}

How can I check if the array already contains the function before appending it to the array ?

Stevik
  • 1,092
  • 2
  • 16
  • 37
  • [answer here](http://stackoverflow.com/questions/24044190/how-to-create-array-of-unique-object-list-in-swift) is what you are looking for i guess. – meth Jan 23 '16 at 20:30
  • 1
    If I remember correctly, you *cannot* compare closures. – Martin R Jan 23 '16 at 20:38

0 Answers0