I'm trying to do something like this:
//: Playground
import Cocoa
protocol FeedItem {
var foo: Int {get}
}
protocol FeedFetchRequest {
func fetchItems<T:FeedItem>(success success: ([T])->())
}
class MyFeedController {
func fetchItems<T:FeedFetchRequest, G:FeedItem>(request: T) {
request.fetchItems{ (items: [G]) -> () in
//do stuff
}
}
}
However, I get the error Generic Parameter 'G' is not used in function signature
. Adding G as an optional return value enables me to use it internally, but this seems hacky, as I don't want to return anything.