ios - Swift: Generic Type conform Protocol -


i have problem generic type. want check if generic type conform protocol , after pass generic function. example have function:

func requestsignal<t:mappable>(target:api) -> signalproducer<[t], nserror>  

and want this:

func request<t>(target:api, withobjecttype type: t.type) {             if let mappabletype = type as? mappable.type {         let requestsignal: signalproducer<[?????], nserror>  = self.requestsignal(target) }  

but if tried pass t - doesn't conform mappable.

if pass mappabletype - not type

you can define t mappable, in first function.

func request<t: mappable> 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -