PFCloud
Objective-C
@interface PFCloud : NSObject
Swift
class PFCloud : NSObject
The PFCloud class provides methods for interacting with Parse Cloud Functions.
-
Calls the given cloud function asynchronously with the parameters provided.
Declaration
Objective-C
+ (id)callFunctionInBackground:(nonnull NSString *)function withParameters:(nullable NSDictionary *)parameters;Swift
class func callFunction(inBackground function: String, withParameters parameters: [AnyHashable : Any]?) -> Any!Parameters
functionThe function name to call.
parametersThe parameters to send to the function.
Return Value
The task, that encapsulates the work being done.
-
Calls the given cloud function asynchronously with the parameters provided and executes the given block when it is done.
Declaration
Objective-C
+ (void)callFunctionInBackground:(nonnull NSString *)function withParameters:(nullable NSDictionary *)parameters block:(nullable PFIdResultBlock)block;Swift
class func callFunction(inBackground function: String, withParameters parameters: [AnyHashable : Any]?, block: PFIdResultBlock? = nil)Parameters
functionThe function name to call.
parametersThe parameters to send to the function.
blockThe block to execute when the function call finished. It should have the following argument signature:
^(id result, NSError *error).
-
Deprecated
Please use
PFCloud.+callFunctionInBackground:withParameters:instead.Calls the given cloud function asynchronously with the parameters provided and then executes the given selector when it is done.
@deprecated Please use
PFCloud.+callFunctionInBackground:withParameters:instead.Declaration
Objective-C
+ (void)callFunctionInBackground:(nonnull NSString *)function withParameters:(nullable NSDictionary *)parameters target:(nullable id)target selector:(nullable SEL)selector;Swift
class func callFunction(inBackground function: String, withParameters parameters: [AnyHashable : Any]?, target: Any?, selector: Selector?)Parameters
functionThe function name to call.
parametersThe parameters to send to the function.
targetThe object to call the selector on.
selectorThe selector to call when the function call finished. It should have the following signature:
(void)callbackWithResult:(id)result error:(NSError *)error. Result will benilif error is set and vice versa.
-
Calls the given cloud function synchronously with the parameters provided.
Declaration
Objective-C
+ (nullable id)callFunction:(nonnull NSString *)function withParameters:(nullable NSDictionary *)parameters;Parameters
functionThe function name to call.
parametersThe parameters to send to the function.
Return Value
The response from the cloud function.
-
Calls the given cloud function synchronously with the parameters provided and sets the error if there is one.
Declaration
Objective-C
+ (nullable id)callFunction:(nonnull NSString *)function withParameters:(nullable NSDictionary *)parameters error:(NSError *_Nullable *_Nullable)error;Swift
class func callFunction(_ function: String, withParameters parameters: [AnyHashable : Any]?) throws -> AnyParameters
functionThe function name to call.
parametersThe parameters to send to the function.
errorPointer to an
NSErrorthat will be set if necessary.Return Value
The response from the cloud function. This result could be a
NSDictionary, anNSArray,NSNumberorNSString.
View on GitHub
Install in Dash