Meteor
public class Meteor
Meteor is a class to simplify communicating with and consuming MeteorJS server services
-
client is a singleton instance of DDPClient
Declaration
Swift
public static let client = Meteor.Client() // Client is a singleton object
-
Sends a subscription request to the server.
Declaration
Swift
public static func subscribe(name:String) -> String { return client.sub(name, params:nil) }
Parameters
name
The name of the subscription.
-
Sends a subscription request to the server.
Declaration
Swift
public static func subscribe(name:String, params:[AnyObject]) -> String { return client.sub(name, params:params) }
Parameters
name
The name of the subscription.
params
An object containing method arguments, if any.
-
Sends a subscription request to the server. If a callback is passed, the callback asynchronously runs when the client receives a ‘ready’ message indicating that the initial subset of documents contained in the subscription has been sent by the server.
Declaration
Swift
public static func subscribe(name:String, params:[AnyObject]?, callback: DDPCallback?) -> String { return client.sub(name, params:params, callback:callback) }
Parameters
name
The name of the subscription.
params
An object containing method arguments, if any.
callback
The closure to be executed when the server sends a ‘ready’ message.
-
Sends a subscription request to the server. If a callback is passed, the callback asynchronously runs when the client receives a ‘ready’ message indicating that the initial subset of documents contained in the subscription has been sent by the server.
Declaration
Swift
public static func subscribe(name:String, callback: DDPCallback?) -> String { return client.sub(name, params:nil, callback:callback) }
Parameters
name
The name of the subscription.
callback
The closure to be executed when the server sends a ‘ready’ message.
-
Call a single function to establish a DDP connection, and login with email and password
Declaration
Swift
public static func connect(url:String, email:String, password:String)
Parameters
url
The url to connect to
email
A string email address associated with a Meteor account
password
A string password
-
Meteor.Client is a subclass of DDPClient that facilitates interaction with the MeteorCollection class
See moreDeclaration
Swift
public class Client: DDPClient