Creating a cold signal in ReactiveCocoa 7

No comments on Creating a cold signal in ReactiveCocoa 7

Written by

in

For any case, there is an arbitrarily complex way to do it.

This prints “HELLO WORLD!”.

let signalProducer = SignalProducer {
            () -> String in
            return "Hello world"
            }
            .map { (s) -> String in
                return s.uppercased() + "!"
            }
        
        signalProducer.startWithValues { (input) in
            print(input)
        }

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *