slick
slick

Reputation: 65

How to Map one Observable<T> to another type Observable<E> in RxSwift?

I have one Observable<[String]>, how do I map it to Another Observable < Dash > where

Class Dash{

var list :[String]
var count :int

} 

for simplicity count is any random integer .

Upvotes: 0

Views: 257

Answers (1)

Daniel T.
Daniel T.

Reputation: 33967

How would you do it if you weren't using Rx? I mean given this:

func convert(texts: [String]) -> Dash {
    // what would you put here?
}

You do the exact same thing in the Observable map closure that you would do in the above function.

Upvotes: 1

Related Questions