Inherits from NSObject
Declared in SRHubservable.h

Overview

An SRHubservable object provides interface for adding Subscriptions to an SRHubProxy

Tasks

Properties

  •   eventName

    An NSString object representing the name of the subscription event

    property
  •   proxy

    An SRHubProxy object representing the Hub to be observed

    property

Initializing an SRHubservable Object

Adding Subscriptions

Properties

eventName

An NSString object representing the name of the subscription event

@property (strong, nonatomic, readonly) NSString *eventName

Declared In

SRHubservable.h

proxy

An SRHubProxy object representing the Hub to be observed

@property (strong, nonatomic, readonly) SRHubProxy *proxy

Declared In

SRHubservable.h

Class Methods

observe:event:

A convenience method for initWithProxy:(SRHubProxy )proxy eventName:(NSString )eventName;

+ (id)observe:(SRHubProxy *)proxy event:(NSString *)eventName

Parameters

proxy

the SRHubProxy object representing the Hub to be observed

eventName

the NSString object representing the name of the subscription event

Return Value

an SRHubservable object

Discussion

SRHubservable *observable = [SRHubservable observe:myHub event:@“myEvent”];

Declared In

SRHubservable.h

Instance Methods

initWithProxy:eventName:

Initializes a new SRHubservable object

- (id)initWithProxy:(SRHubProxy *)proxy eventName:(NSString *)eventName

Parameters

proxy

the SRHubProxy object representing the Hub to be observed

eventName

the NSString object representing the name of the subscription event

Return Value

an SRHubservable object

Discussion

SRHubservable *observable = [SRHubservable observe:myHub event:@“myEvent”];

Declared In

SRHubservable.h

subscribe:selector:

Adds a new Subscription to the underlying proxy for eventName

- (SRSubscription *)subscribe:(NSObject *)object selector:(SEL)selector

Parameters

object

The receiver to perform selector on

selector

A selector identifying the message to send.

Return Value

the SRSubscription object created

Declared In

SRHubservable.h