SRHubProxy Class Reference
| Inherits from | NSObject | 
| Declared in | SRHubProxy.h | 
Tasks
Properties
- 
	
		
connectionThe
propertySRConnectionobject corresponding to underlyingSRConnection - 
	
		
hubNameThe
propertyNSStringobject corresponding to the hubname - 
	
		
stateAn
propertyNSMutableDictionaryobject that manages the state of the SignalR Hub - 
	
		
subscriptionsAn
propertyNSMutableDictionaryobject that manages theSRSubscriptionsthat have been defined on the hub 
Initializing an SRHubProxy Object
- 
	
		
– initWithConnection:hubName:Initializes a new
SRHubProxyobject with the specifiedSRConnectionand hubname 
Subscription Management
- 
	
		
– subscribe:Adds a new
SRSubscriptionto the hubproxy for eventName - 
	
		
– getSubscriptionsan
NSArrayobject of the subscription event names - 
	
		
– invokeEvent:withArgs:Invokes the
SRSubscriptionobject that corresponds to eventName 
State Management
- 
	
		
– getMember:Returns the object corresponding to name in the state dictionary
 - 
	
		
– setMember:object:Adds a given key-value pair to the state dictionary.
 - 
	
		
– invoke:withArgs:Invokes a SignalR Server Hub method with the specified method name and arguments calls [self inoke:method arg:args continueWith:nil];
 - 
	
		
– invoke:withArgs:continueWith:Invokes a SignalR Server Hub method with the specified method name and arguments
 
Extensions Methods
- 
	
		
– getValue:An extension method for accessing objects contained in the
SRHubProxystate dictionary - 
	
		
– on:perform:selector:Creates a new
SRSubscriptionobject - 
	
		
– observe:Initalizes an
SRHubservablewith the specified eventName 
Properties
connection
The SRConnection object corresponding to underlying SRConnection
@property (strong, nonatomic, readonly) SRConnection *connectionDeclared In
SRHubProxy.hhubName
The NSString object corresponding to the hubname
@property (strong, nonatomic, readonly) NSString *hubNameDeclared In
SRHubProxy.hstate
An NSMutableDictionary object that manages the state of the SignalR Hub
@property (strong, nonatomic, readonly) NSMutableDictionary *stateDeclared In
SRHubProxy.hInstance Methods
getMember:
Returns the object corresponding to name in the state dictionary
- (id)getMember:(NSString *)nameParameters
- name
 the key for which to return the corresponding value.
Return Value
Returns the value associated with a given key.
Declared In
SRHubProxy.hgetSubscriptions
an NSArray object of the subscription event names
- (NSArray *)getSubscriptionsReturn Value
an NSArray object of the subscription event names
Declared In
SRHubProxy.hgetValue:
An extension method for accessing objects contained in the SRHubProxy state dictionary
- (id)getValue:(NSString *)nameParameters
- name
 the key for which to return the corresponding value.
Return Value
Returns the value associated with a given key.
Declared In
SRHubProxyExtensions.hinitWithConnection:hubName:
Initializes a new SRHubProxy object with the specified SRConnection and hubname
- (id)initWithConnection:(SRConnection *)connection hubName:(NSString *)hubnameParameters
- connection
 the connection to initialize the hub on
- hubname
 an
NSStringrepresenting the hubname
Return Value
an SRHubProxy object
Discussion
Important the hubname needs to be the full type name of the hub.
Declared In
SRHubProxy.hinvoke:withArgs:
Invokes a SignalR Server Hub method with the specified method name and arguments calls [self inoke:method arg:args continueWith:nil];
- (void)invoke:(NSString *)method withArgs:(NSArray *)argsParameters
- method
 the
NSStringobject representing the name of the server method to invoke
- args
 the arguments to pass as part of the invocation
Declared In
SRHubProxy.hinvoke:withArgs:continueWith:
Invokes a SignalR Server Hub method with the specified method name and arguments
- (void)invoke:(NSString *)method withArgs:(NSArray *)args continueWith:(void ( ^ ) ( id data ))responseBlockParameters
- method
 the
NSStringobject representing the name of the server method to invoke
- args
 the arguments to pass as part of the invocation
- responseBlock
 the block to be called once the server method is invoked, this may be nil
Declared In
SRHubProxy.hinvokeEvent:withArgs:
Invokes the SRSubscription object that corresponds to eventName
- (void)invokeEvent:(NSString *)eventName withArgs:(NSArray *)argsParameters
- eventName
 the
NSStringobject representing the name of the subscription event
- args
 the arguments to pass as part of the invocation
Declared In
SRHubProxy.hobserve:
Initalizes an SRHubservable with the specified eventName
- (SRHubservable *)observe:(NSString *)eventNameParameters
- eventName
 the
NSStringobject representing the name of the subscription event
Return Value
an SRHubservable object
Declared In
SRHubProxyExtensions.hon:perform:selector:
Creates a new SRSubscription object
- (SRSubscription *)on:(NSString *)eventName perform:(NSObject *)object selector:(SEL)selectorParameters
- eventName
 the name of the event to subscribe to
- object
 The receiver to perform selector on
- selector
 A selector identifying the message to send.
Return Value
An instance of an SRSubscription object
Declared In
SRHubProxyExtensions.hsetMember:object:
Adds a given key-value pair to the state dictionary.
- (void)setMember:(NSString *)name object:(id)valueParameters
- name
 The key for value
- value
 The value for key.
Declared In
SRHubProxy.hsubscribe:
Adds a new SRSubscription to the hubproxy for eventName
- (SRSubscription *)subscribe:(NSString *)eventNameParameters
- eventName
 the
NSStringobject representing the name of the subscription event
Return Value
the SRSubscription object created
Declared In
SRHubProxy.h