Navigation

Call a Function - iOS SDK

On this page

  • Call a Function by Name

Consider a Realm function named concatenate that takes two arguments, concatenates them, and returns the result:

// concatenate: concatenate two strings
exports = function(a, b) {
return a + b;
};

To execute a function from the iOS Client SDK, use the functions object on the currently logged-in user.

The functions object has dynamic members corresponding to functions. In this case, functions.concatenate() refers to the concatenate function. Pass a BSONArray of arguments. The trailing closure is the completion handler to call when the function call is complete. This handler is executed on a non-main global DispatchQueue.

Give Feedback

On this page

  • Call a Function by Name