Request

class Request

Extension to Alamofire.Request providing ReactiveCocoa signals for each of the .response...() methods.

  • A SignalProducer is returned over a Request for use with ReactiveCococa. If the response is succesful, the serialized object is sent to the producer as a .Next(_) event followed by a .Completed event. If the response fails, a .Failed event is sent to the producer.

    Declaration

    Swift

    public func rac_response<T: ResponseSerializerType>(queue: dispatch_queue_t? = nil, responseSerializer:T) -> SignalProducer<T.SerializedObject, NSError>

    Parameters

    queue

    The queue on which the response completion handler is dispatched.

    responseSerializer

    The response serializer responsible for serializing the request, response, and data.

    Return Value

    A SignalProducer that schedules a handler with the given responseSerializer on start().

  • Convenience ReactiveCocoa response using a dataResponseSerializer().

    Declaration

    Swift

    public func rac_responseData(queue: dispatch_queue_t? = nil) -> SignalProducer<NSData, NSError>
  • Convenience ReactiveCocoa response using a stringResponseSerializer().

    Declaration

    Swift

    public func rac_responseString(queue: dispatch_queue_t? = nil) -> SignalProducer<String, NSError>
  • Convenience ReactiveCocoa response using a JSONResponseSerializer().

    Declaration

    Swift

    public func rac_responseJSON(queue: dispatch_queue_t? = nil) -> SignalProducer<AnyObject, NSError>
  • Convenience ReactiveCocoa response using a propertyListResponseSerializer().

    Declaration

    Swift

    public func rac_responsePropertyList(queue: dispatch_queue_t? = nil) -> SignalProducer<AnyObject, NSError>