2

I have defined a function with the following signature:

 public func loginUser(username: String) -> ReactiveCocoa.Signal<String, NSError>

I am trying to call the method toRACSignal and pass it the result of loginUser.

The signatures for toRACSignal are:

 func toRACSignal<T, E>(signal: ReactiveCocoa.Signal<T, E>) -> RACSignal
 func toRACSignal<T, E>(signal: ReactiveCocoa.Signal<T?, E>) -> RACSignal

My attempt looks like this:

  public func RACLoginUser(username: String) -> RACSignal {
     let signal = loginUser(username)
     return toRACSignal(signal)   
  }

but this results in an error saying:

Error:(33, 12) cannot find an overload for 'toRACSignal' that accepts an argument list of type '(Signal)'

What am I doing wrong?

1 Answer 1

1

I just figured it out. The problem is that String is not an object in Swift. Replace with NSString (or any other object) and it works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.