I'm having some issues trying to run this code, I found couple examples using the same code but I get compiler error
Undefined symbols for architecture arm64: "ExpSwift.SearchResults.generate () -> Swift.IndexingGenerator<[A]>", referenced from: ExpSwift_Example.ViewController.(viewDidLoad () -> ()).(closure #1).(closure #3) in ViewController.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
here is my code class
public final class SearchResults<T> {
var results = [T]();
let total: Int64
required public init?(results: [T], total: Int64) {
self.results = results
self.total = total
}
public func getResults() -> [T] {
return self.results
}
public func getTotal() -> Int64 {
return self.total
}
}
extension SearchResults : SequenceType {
public func generate() -> IndexingGenerator<Array<T>> {
return results.generate()
}
}
and then calling this with Alamofire
ExpSwift.findLocations(["limit":10, "skip":0, "sort":"name"]).then { (locations: SearchResults<Location>) -> Void in
for location:Location in locations{
debugPrint(location.get("name"))
}
}.error { error in
debugPrint(error)
}