vendredi 30 janvier 2015

Swift function with a closure parameter seen as error type inside Unit Testing Module

I'm trying to write Unit tests for my Article Model. I have added the model as a test target.


I am able to access class functions without closure parameters in it but when I try to use a function with a closure, here's what Xcode's autocompletion gave


enter image description here


The full function prototype of 'fetchArticles' looks likes this:



class func fetchArticles(referringTile:Tile,completion:(articles:[Article])->(Void),
failure:(error:NSError)->(Void))


I've also tried declaring the function as 'public' but it didn't work.


Aucun commentaire:

Enregistrer un commentaire