BuiltObject Class Reference

Inherits from NSObject
Declared in BuiltObject.h

Overview

An object is a instance of a Class

Other Methods

  uid

The uid of the object

@property (nullable, nonatomic, copy) NSString *uid

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 NSString *objectUID = projectObject.uid;

 //Swift
 var objectUID:String = projectObject.uid

Declared In

BuiltObject.h

  ACL

ACL for the object

@property (nonatomic, strong) BuiltACL *ACL

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 BuiltACL *builtAcl = projectObject.ACL;

 //Swift
 var builtAcl:BuiltACL = projectObject.ACL

Declared In

BuiltObject.h

  deleted

Check if the object is deleted or not [Gets used in delta calls].

@property (nonatomic, assign, readonly, getter=isDeleted) BOOL deleted

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 if (projectObject.isDeleted) {
    //object is deleted
 } else {
    //object is not yet delete
 }

 //Swift
 if (projectObject.isDeleted()) {
    //object is deleted
 } else {
    //object is not yet delete
 }

Declared In

BuiltObject.h

  isNew

Helps to check whether its a new or existing object on Built.io Backend.

@property (nonatomic, assign, readonly) BOOL isNew

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 if (projectObject.isNew) {
    //New Object
 } else {
    //Old Object
 }

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 if (projectObject.isNew) {
    //New Object
 } else {
    //old Object
 }

*

Declared In

BuiltObject.h

  tags

Tags list in Array

@property (nonatomic, strong) NSArray *tags

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 //setting tags
 projectObject.tags = @[@"ui", @"ux"];

 //getting tags
 NSArray *tagFileArray = [projectObject tags];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 //setting tags
 projectObject.tags = ["ui", "ux"]

 //getting tags
 var tagFileArray:NSArray! = projectObject.tags

Declared In

BuiltObject.h

  createdAt

Created date of object.

@property (nonatomic, strong, readonly) NSDate *createdAt

Discussion

//Assuming 'projectObject' is a BuiltObject instance

//Obj-C
NSDate *objectCreatedDate = projectObject.createdAt;

//Swift
var objectCreatedDate:Date = projectObject.createdAt

Declared In

BuiltObject.h

  updatedAt

Last updated date of object.

@property (nonatomic, strong, readonly) NSDate *updatedAt

Discussion

//Assuming 'projectObject' is a BuiltObject instance

//Obj-C
NSDate *objectUpdatedDate = projectObject.updatedAt;

//Swift
var objectUpdatedDate:Date = projectObject.updatedAt

Declared In

BuiltObject.h

  deletedAt

Deleted date of object.

@property (nonatomic, strong, readonly) NSDate *deletedAt

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 NSDate *objectDeletedDate = projectObject.deletedAt;

 //Swift
 var objectDeletedDate:Date = projectObject.deletedAt

Declared In

BuiltObject.h

  location

BuiltLocation object representing latitute and longitude of an object

@property (nonatomic, strong) BuiltLocation *location

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 BuiltLocation *builtLocation = projectObject.location;

 //Swift
 var builtLocation:BuiltLocation = projectObject.location

Declared In

BuiltObject.h

  extensionKey

To set extensionKey for the object. // ‘blt5d4sample2633b’ is a dummy Application API key

@property (nonnull, nonatomic, strong) NSString *extensionKey

Discussion

//Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltClass projectClass = [builtApplication classWithUID:@“project”]; BuiltObject *projectObject = [projectClass object]; projectObject.extensionKey = @“new_extension”;

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) var projectClass:BuiltClass = builtApplication.classWithUID(“project”) var projectObject:BuiltObject = projectClass.object() projectObject.extensionKey = “new_extension”;

Declared In

BuiltObject.h

Headers

– setHeader:forKey:

Set a header for an application

- (void)setHeader:(NSString *)headerValue forKey:(NSString *)headerKey

Parameters

headerValue

The header key

headerKey

The header value

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 [projectObject setHeader:@"MyHeaderValue" forKey:@"My-Custom-Header-Key"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject.setHeader("MyHeaderValue", forKey:"My-Custom-Header-Key")

Declared In

BuiltObject.h

– addHeadersWithDictionary:

Set a header for an application

- (void)addHeadersWithDictionary:(NSDictionary *)headers

Parameters

headers

The headers as dictionary which needs to be added to the application

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 [projectObject addHeadersWithDictionary:@{@"My-Custom-Header-Key":@"MyHeaderValue"}];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject.addHeadersWithDictionary(["My-Custom-Header-Key":"MyHeaderValue"])

Declared In

BuiltObject.h

– removeHeaderForKey:

Removes a header from this application.

- (void)removeHeaderForKey:(NSString *)headerKey

Parameters

headerKey

The header key that needs to be removed

Discussion

 //'blt5d4sample2633b' is a dummy Application API key

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 [projectObject removeHeaderForKey:@"My-Custom-Header-Key"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject.removeHeaderForKey("My-Custom-Header-Key")

Declared In

BuiltObject.h

Access object values

– hasKey:

Checks whether the object has a given property

- (BOOL)hasKey:(NSString *)key

Parameters

key

The property to be checked

Return Value

YES if key exists, NO if not

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 BOOL hashKey = [projectObject hasKey:@"key"];
 if (hashKey) {
    //Hash Key
 } else {
    //No hash key
 }

 //Swift
 var hashKey:Bool = projectObject.hasKey("key")
 if (hashKey) {
    //Hash Key
 } else {
    //No Hash Key
 }

Declared In

BuiltObject.h

– objectForKey:

Gets the data for given property.

- (BUILT_NULLABLE id)objectForKey:(NSString *)key

Parameters

key

The object’s property

Return Value

The value for the key provided

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 id object = [projectObject objectForKey:@"key"];

 //Swift
 var object = projectObject.objectForKey("key")

Declared In

BuiltObject.h

Timeless

– applyTimeless

Issues a timeless update, which means date of creation and updation are not modified.

- (void)applyTimeless

Discussion

 //'blt5d4sample2633b' is a dummy Application API key
 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 [projectObject applyTimeless];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject.applyTimeless()

Declared In

BuiltObject.h

Reference

– setReference:forKey:

Assigns a set references to a reference field of an object.

- (void)setReference:(id)reference forKey:(NSString *)key

Parameters

reference

This can either be a UID of a referenced object as String or array of UIDs of a referenced objects.

key

The uid of the reference field

Discussion

//Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltClass taskClass = [builtApplication classWithUID:@“task”]; BuiltObject *taskObject = [taskClass object]; // setting the project reference [taskObject setReference:@“bltb6202sample73a1” forKey:@“project”];

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) var taskClass:BuiltClass = builtApplication.classWithUID(“task”) var taskObject:BuiltObject = taskClass.object() // setting the project reference taskObject.setReference(“bltb6202sample73a1”, forKey:“project”)

Declared In

BuiltObject.h

– setReferenceWithObject:forKey:

Assigns a set references to a reference field of an object.

- (void)setReferenceWithObject:(id)referenceObject forKey:(NSString *)key

Parameters

key

The uid of the reference field

reference

This can either an instance of BuiltObject or array of BuiltObject instance.

Discussion

//Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltClass projectClass = [builtApplication classWithUID:@“project”]; BuiltObject *projectObject = [projectClass object]; projectObject[@“name”] = @“Super Project #41!”;

BuiltClass taskClass = [builtApplication classWithUID:@“task”]; BuiltObject taskObject = [taskClass object]; // setting the project reference [taskObject setReferenceWithObject:projectObject forKey:@“project”];

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) var projectClass:BuiltClass = builtApplication.classWithUID(“project”) var projectObject:BuiltObject = projectClass.object() projectObject[“name”] = “Super Project #41!”

var taskClass:BuiltClass = builtApplication.classWithUID(“task”) var taskObject:BuiltObject = taskClass.object() // setting the project reference taskObject.setReferenceWithObject(projectObject, forKey:“project”)

Declared In

BuiltObject.h

– setReferenceWhere:forKey:

Fires a query on Built.io Backend and all the objects which pass the query condition are being assigned to the reference field.

- (void)setReferenceWhere:(NSDictionary *)dictionary forKey:(NSString *)key

Parameters

dictionary

Object specifying the conditions

key

The uid of the reference field

Discussion

//Obj-C BuiltApplication builtApplication = [Built applicationWithAPIKey:@“blt5d4sample2633b”]; BuiltClass taskClass = [builtApplication classWithUID:@“task”]; BuiltObject *taskObject = [taskClass object]; [taskObject setReferenceWhere:@{@“name”:@“Super Project #41!”} forKey:@“project”];

//Swift var builtApplication:BuiltApplication = Built.applicationWithAPIKey(“blt5d4sample2633b”) var taskClass:BuiltClass = builtApplication.classWithUID(“task”) var taskObject:BuiltObject = taskClass.object() taskObject.setReferenceWhere([“name”:“Super Project #41!”], forKey:“project”)

Declared In

BuiltObject.h

Upsert

– upsert:

Upserts the object (Updates the matching object if found on Built.io Backend or creates a new object)

- (void)upsert:(NSDictionary *)dictionary

Parameters

dictionary

A check will be performed, whether any object has the key value pair(s) supplied in the dictionary

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 projectObject[@"name"] = @"Super Project #41!"
 [projectObject upsert:@{@"name":@"Super Project #41!"}];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject["name"] = "Super Project #41!"
 projectObject.upsert(["name":"Super Project #41!"])

Declared In

BuiltObject.h

– addUpsertForReference:condition:replaceWith:

Use this method only when the values of the fields inside referenced object is to be changed while creating a new object.

- (void)addUpsertForReference:(NSString *)referenceField condition:(NSDictionary *)conditionDictionary replaceWith:(NSDictionary *)replaceDictionary

Parameters

referenceField

Reference field uid on which UPSERT has to be performed

conditionDictionary

A check will be performed, whether any object has the key value pair(s) supplied in the dictionary in the reference field

replaceDictionary

New key value pairs for the fields inside the referenced object

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
BuiltClass *taskClass = [builtApplication classWithUID:@"task"];
BuiltObject *taskObject  = [taskClass object];
[taskObject addUpsertForReference:@"project" condition:@{@"name":@"Super Project #41!"} replaceWith:@{@"description":@"This is a very cool project"}]

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
var taskClass:BuiltClass = builtApplication.classWithUID("task")
var taskObject:BuiltObject = taskClass.object()
taskObject.addUpsertForReference("project", condition:["name":"Super Project #41!"], replaceWith:@{"description":"This is a very cool project"})

Declared In

BuiltObject.h

– addUpsertForReferences:condition:replaceWith:

Use this method only when the values of the fields inside referenced objects are to be changed while creating a new objects.

- (void)addUpsertForReferences:(NSString *)referenceField condition:(NSDictionary *)conditionDictionary replaceWith:(NSDictionary *)replaceDictionary

Parameters

referenceField

Reference field uid (Which is marked as multiple) on which UPSERT has to be performed

conditionDictionary

A check will be performed, whether any object has the key value pair(s) supplied in the dictionary in the reference field

replaceDictionary

New key value pairs for the fields inside the referenced object

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *taskClass = [builtApplication classWithUID:@"task"];
 BuiltObject *taskObject  = [taskClass object];
 [taskObject addUpsertForReferences:@"project" condition:@{@"name":@"Super Project #41!"} replaceWith:@{@"description":@"This is a very cool project"}];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var taskClass:BuiltClass = builtApplication.classWithUID("task")
 var taskObject:BuiltObject = taskClass.object()
 taskObject.addUpsertForReferences("project", condition:["name":"Super Project #41!"], replaceWith:["description":"This is a very cool project"])

Declared In

BuiltObject.h

Owner

– hasOwner

Check if object has owner

- (BOOL)hasOwner

Return Value

YES if object has owner else NO

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 if (projectObject.hasOwner) {
    //Object has a owner
 } else {
    //Object has no owner
 }


 //Swift
 if (projectObject.hasOwner()) {
    //Object has a owner
 } else {
    //Object has no owner
 }

Declared In

BuiltObject.h

– owner

Returns owner if the object has owner

- (BUILT_NULLABLE id)owner

Return Value

Owner of the object

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 id objectOwner = [projectObject owner];

 //Swift
 var owner:AnyObject = projectObject.owner()

Declared In

BuiltObject.h

– ownerUID

Get the UID of the owner of the object

- (BUILT_NULLABLE NSString *)ownerUID

Return Value

UID of the owner

Discussion

 //Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 NSString *objectOwnerUID = [projectObject ownerUID];

 //Swift
 var objectOwnerUID:String = projectObject.ownerUID()

Declared In

BuiltObject.h

– ownerEmail

Get the email of the owner of the object

- (BUILT_NULLABLE NSString *)ownerEmail

Return Value

email of the owner of the object

Discussion

//Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 NSString *objectOwnerEmail = [projectObject ownerEmail];

 //Swift
 var objectOwnerEmail:String = projectObject.ownerEmail()

Declared In

BuiltObject.h

Increment, Decrement, Multiply, Divide

– incrementKey:by:

Increments the number field by a given amount (Note: Increment is done on the server)

- (void)incrementKey:(NSString *)key by:(NSNumber *)number

Parameters

key

Uid of number field

number

By how much amount to increment

Discussion

//Assuming 'personObject' is a BuiltObject instance

 //Obj-C
 [personObject incrementKey:@"age" by:@(2)];

 //Swift
 personObject.incrementKey("age", by:NSNumber(int: 2))

Declared In

BuiltObject.h

– decrementKey:by:

Decrements the number field by a given amount (Note: Decrement is done on the server)

- (void)decrementKey:(NSString *)key by:(NSNumber *)number

Parameters

key

Uid of number field

number

By how much amount to decrement

Discussion

 //Assuming 'personObject' is a BuiltObject instance

 //Obj-C
 [personObject decrementKey:@"age" by:@(2)];

 //Swift
 personObject.decrementKey("age", by:NSNumber(int: 2))

Declared In

BuiltObject.h

Push/Pull

– pushValue:forKey:

Appends a value in the given field.(Applies only to fields that allow multiple values)

- (void)pushValue:(id)value forKey:(NSString *)key

Parameters

value

Value to be pushed

key

Uid of field

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *taskClass = [builtApplication classWithUID:@"task"];
 // 'bltf50esamplefeb' is uid of an object of 'task' class
 BuiltObject *taskObject = [taskClass objectWithUID:@"bltf50esamplefeb"];
 [taskObject pushValue: @{@"name": @"new task", @"description": @"newest task"} forKey:@"steps"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var taskClass:BuiltClass = builtApplication.classWithUID("task")
 // 'bltf50esamplefeb' is uid of an object of 'task' class
 var taskObject:BuiltObject = taskClass.objectWithUID("bltf50esamplefeb")
 taskObject.pushValue(NSArray(objects: ["name" : "new task", "description" : "newest task"]), forKey: "steps") 

Declared In

BuiltObject.h

– pullValue:forKey:

For the given field, it deletes the first matched value.(Applies only to fields that allow multiple values)

- (void)pullValue:(id)value forKey:(NSString *)key

Parameters

value

Values to be deleted

key

Uid of field

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *taskClass = [builtApplication classWithUID:@"task"];
 BuiltObject *taskObject  = [taskClass object];
 [taskObject pullValue:@"will come at front" forKey:@"steps.name"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var taskClass:BuiltClass = builtApplication.classWithUID("task")
 var taskObject:BuiltObject = taskClass.object()
 taskObject.pullValue("will come at front", forKey:"steps.name")

Declared In

BuiltObject.h

– updateValue:atIndex:forKey:

A value in a field that allows multiple values

- (void)updateValue:(id)updatedValue atIndex:(NSInteger)index forKey:(NSString *)key

Parameters

updatedValue

New value to be updated

index

Index at which the value is to be updated

key

Uid of field

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *taskClass = [builtApplication classWithUID:@"task"];
 BuiltObject *taskObject  = [taskClass object];
 [taskObject updateValue:@"John" atIndex:0 forKey:@"members"];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var taskClass:BuiltClass = builtApplication.classWithUID("task")
 var taskObject:BuiltObject = taskClass.object()
 taskObject.updateValue("John", atIndex: 0, forKey: "members")

Declared In

BuiltObject.h

– setObject:forKey:

Use this method to add a new key value pair in group.

- (void)setObject:(id)object forKey:(NSString *)key

Parameters

object

object to set

key

key to assign on.

Declared In

BuiltObject.h

Manage BuiltGroup/BuiltGroupMultiple

– addGroup:

Adds Group to this object

- (void)addGroup:(BuiltGroup *)group

Parameters

group

Instance of BuiltGroup for this object

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *bugClass = [builtApplication classWithUID:@"bug"];
 BuiltObject *bugObject  = [bugClass object];

 BuiltGroup *detailGroup  = [BuiltGroup groupWithField:@"details"];
 detailGroup[@"title"] = @"UI Bug";
 [bugObject addGroup:detailGroup];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var bugClass:BuiltClass = builtApplication.classWithUID("bug")

 var bugObject:BuiltObject = bugClass.object()
 var detailGroup:BuiltGroup = BuiltGroup(field: "details")
 detailGroup["title"] = "UI Bug"
 bugObject.addGroup(detailGroup)

Declared In

BuiltObject.h

– addGroupMultiple:

Adds GroupMultiple to this object

- (void)addGroupMultiple:(BuiltGroupMultiple *)groupMultiple

Parameters

groupMultiple

Instance of BuiltGroupMultiple for this object

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *bugClass = [builtApplication classWithUID:@"bug"];
 BuiltObject *bugObject  = [bugClass object];

 BuiltGroup *step1 = [BuiltGroup group];
 step1[@"title"] = @"Click view button";

 BuiltGroup *steps2 = [BuiltGroup group];
 step2[@"title"] = @"Click on list";

 BuiltGroupMultiple *stepsGroup = [BuiltGroupMultiple groupMultipleWithField:@"steps"];
 [stepsGroup addGroup:step1];
 [stepsGroup addGroup:step2];

 [bugObject addGroupMultiple:stepsGroup];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var bugClass:BuiltClass = builtApplication.classWithUID("bug")

 var bugObject:BuiltObject = bugClass.object()

 var step1:BuiltObject = BuiltGroup(field: "steps1")
 step1["title"] = "Click view button"

 var step2:BuiltObject = BuiltGroup(field: "steps2")
 step2["title"] = "Click on list"

 var stepsGroup:BuiltGroupMultiple = BuiltGroupMultiple(field: "steps")
 stepsGroup.addGroup(step1)
 stepsGroup.addGroup(step2)

  bugObject.addGroupMultiple(stepsGroup)

Warning: This method has been deprecated.

Declared In

BuiltObject.h

– groupForKey:

Get the info of the specified key of BuiltGroup object and returns instance of BuiltGroup.

- (nullable BuiltGroup *)groupForKey:(NSString *)key

Parameters

key

Key containing the value of BuiltGroup

Return Value

Instance of BuiltGroup

Discussion

 // 'details' is a key in bug class for group

 //Obj-C
 BuiltGroup *detailsGroup = [bugObject groupForKey:@"details"];

 //Swift
 var detailsGroup:BuiltGroup =  bugObject.groupForKey("details")

Declared In

BuiltObject.h

– groupMultipleForKey:

Get the info of the specified key of BuiltGroupMultiple object and returns instance of BuiltGroupMultiple.

- (nullable BuiltGroupMultiple *)groupMultipleForKey:(NSString *)key

Parameters

key

Key containing the value of BuiltGroupMultiple

Return Value

Instance of BuiltGroupMultiple

Discussion

 // 'steps' is a key in bug class for group multiple

 //Obj-C
 BuiltGroupMultiple *stepsGroup = [bugObject groupMultipleForKey:@"steps"];

 //Swift
 var stepsGroup:BuiltGroupMultiple =  bugObject.groupMultipleForKey("steps")

Warning: This method has been deprecated.

Declared In

BuiltObject.h

Object fetch

– fetch:

Fetches an object asynchronously provided object UID and class UID

- (void)fetch:(void ( ^ ) ( BuiltResponseType responseType , BuiltObject *BUILT_NULLABLE_P object , NSError *BUILT_NULLABLE_P error ))completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, id responseJSON, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 //'bltf4fsamplec851db' is uid of an object of 'project' class
 BuiltObject *projectObject  = [projectClass objectWithUID:@"bltf4fsamplec851db"];
 [projectObject fetch:^(BuiltResponseType responseType, BuiltObject *object, NSError *error) {

 }];


 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 //'bltf4fsamplec851db' is uid of an object of 'project' class
 var projectObject:BuiltObject = projectClass.objectWithUID("bltf4fsamplec851db")
 projectObject.fetch { (responseType, object!, error!) -> Void in

 }

Declared In

BuiltObject.h

– getAllObjectsForKey:withClassUID:

Returns an array of BuiltObjects for the specified reference key

- (BUILT_NULLABLE NSArray *)getAllObjectsForKey:(NSString *)key withClassUID:(NSString *)classUID

Parameters

key

the reference field key

classUID

set the class uid of the class to which the object(s) belongs

Return Value

An array of BuiltObjects for the specified key

Discussion

Use this method to retrieve BuiltObjects when using includeRefFieldWithKey: method of BuiltQuery. The reference field key may have an array of objects or a single object. This method will return the BuiltObjects for the included reference field.

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *taskClass = [builtApplication classWithUID:@"task"];
 //'bltf4fsamplec851db' is uid of an object of 'task' class
 BuiltObject *taskObject  = [taskClass objectWithUID:@"bltf4fsamplec851db"];
 NSArray *projectsArray = [taskObject  getAllObjectsForKey:@"project" withClassUID:@"project"];


 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var taskClass:BuiltClass = builtApplication.classWithUID("task")
 //'bltf4fsamplec851db' is uid of an object of 'task' class
 var taskObject:BuiltObject = taskClass.objectWithUID("bltf4fsamplec851db")
 var projectsArray:AnyObject = taskObject.getAllObjectsForKey("project", withClassUID:"project")

Declared In

BuiltObject.h

Save

– saveAsDraft:

Saves an object as draft asyncronously so that it is not visible unless explicitly called for. see including drafts

- (void)saveAsDraft:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 projectObject[@"name"] = @"Super Project #41!";
 projectObject[@"description"] = @"This is a very cool project";
 [projectObject saveAsDraft:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject["name"] = "Super Project #41!"
 projectObject["description"] = "This is a very cool project"
 projectObject.saveAsDraft { (responseType, error!) -> Void in

 }

Declared In

BuiltObject.h

– save:

Saves an BuiltObject asyncronously to Built.io Backend servers

- (void)save:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 projectObject[@"name"] = @"Super Project #41!";
 projectObject[@"description"] = @"This is a very cool project";
 [projectObject save:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject["name"] = "Super Project #41!"
 projectObject["description"] = "This is a very cool project"
 projectObject.save { (responseType, error!) -> Void in

 }

Declared In

BuiltObject.h

– saveAsDraftEventually:

Saves an object as draft asyncronously so that it is not visible unless explicitly called for. see including drafts

- (void)saveAsDraftEventually:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 projectObject[@"name"] = @"Super Project #41!";
 projectObject[@"description"] = @"This is a very cool project";
 [projectObject saveAsDraftEventually:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject["name"] = "Super Project #41!"
 projectObject["description"] = "This is a very cool project"
 projectObject.saveAsDraftEventually { (responseType, error!) -> Void in

 }

Declared In

BuiltObject.h

– saveEventually:

Saves an BuiltObject asyncronously if network is unavailable. Resumes when network becomes available.

- (void)saveEventually:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject  = [projectClass object];
 projectObject[@"name"] = @"Super Project #41!";
 projectObject[@"description"] = @"This is a very cool project";
 [projectObject  saveEventually:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject["name"] = "Super Project #41!"
 projectObject["description"] = "This is a very cool project"
 projectObject.saveEventually { (responseType, error!) -> Void in

 }

Declared In

BuiltObject.h

Import Excel

– importFromExcelWithPath:completion:

Imports excel file asyncronously to Built.io Backend servers.

- (void)importFromExcelWithPath:(NSString *)filePath completion:(BuiltRequestCompletionHandler)completionBlock

Parameters

filePath

of a valid excel file we wish to import to.

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

//Obj-C
BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
BuiltObject *projectObject  = [projectClass object];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"person.xlsx"];
[projectObject importFromExcelWithPath:filePath completion:^(BuiltResponseType responseType, NSError * _Nonnull error) {
 }];

//Swift
var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
var projectClass:BuiltClass = builtApplication.classWithUID("project")
var projectObject:BuiltObject = projectClass.object()
let fileManager = FileManager.default
if let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first {
let filePath = documentsDirectory.appendingPathComponent("person.xlsx").path
projectObject.importFromExcel(withPath: filePath, completion: { (response, err) in

})
}

Note: filePath should have readable permission

Declared In

BuiltObject.h

Delete

– destroy:

Deletes the BuiltObject asyncronously with specified object UID.

- (void)destroy:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 //'bltf50esamplefeb' is uid of an object of 'project' class
 BuiltObject *projectObject  = [projectClass objectWithUID:@"bltf50esamplefeb"];
 [projectObject  destroy:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 //'bltf50esamplefeb' is uid of an object of 'project' class
 var projectObject:BuiltObject = projectClass.objectWithUID("bltf50esamplefeb")
 projectObject.destroy { (responseType, error!) -> Void in

 }

Declared In

BuiltObject.h

– destroyEventually:

Deletes the BuiltObject asyncronously with specified object UID. Drafts the operation if network is unavailable. Resumes after network is back.

- (void)destroyEventually:(BuiltRequestCompletionHandler)completionBlock

Parameters

completionBlock

Completion block with params (BuiltResponseType responseType, NSError *error)

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 //'bltf50esamplefeb' is uid of an object of 'project' class
 BuiltObject *projectObject  = [projectClass objectWithUID:@"bltf50esamplefeb"];
 [projectObject  destroyEventually:^(BuiltResponseType responseType, NSError *error) {

 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 //'bltf50esamplefeb' is uid of an object of 'project' class
 var projectObject:BuiltObject = projectClass.objectWithUID("bltf50esamplefeb")
 projectObject.destroyEventually { (responseType, error!) -> Void in

 }

Declared In

BuiltObject.h

Only and Except

– includeOnlyFields:

Specifies an array of ‘only’ keys in BASE object that would be included in the response.

- (void)includeOnlyFields:(NSArray *)fieldUIDs

Parameters

fieldUIDs

Array of the ‘only’ keys to be included in response.

Discussion

 //Obj-C
 [taskObject includeOnlyFields:@["project"]];

 //Swift
 taskObject.includeOnlyFields(["project"])

Specifies an array of keys in BASE object that would be included in the response.

Declared In

BuiltObject.h

– includeAllFieldsExcept:

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

- (void)includeAllFieldsExcept:(NSArray *)fieldUIDs

Parameters

fieldUIDs

Array of keys to be excluded from the response.

Discussion

 //Obj-C
 [taskObject includeAllFieldsExcept:@["project"]];

 //Swift
 taskObject.includeAllFieldsExcept(["project"])

Specifies an array of keys in BASE object that would be ‘excluded’ from the response.

Declared In

BuiltObject.h

Include Reference

– includeReference:

Include reference objects with given key in response

- (void)includeReference:(NSArray *)key

Parameters

key

Array of reference keys to include in response.

Discussion

 //Obj-C
 [taskObject includeReference:@[@"project"]];

 //Swift
 taskObject.includeReference(["project"])

The include parameter accepts the name of a reference field. By default, no reference field is bought along with the object, only the uids are. To include any reference, this parameter must be used. Nested references can be bought by “.” separating the references. This will work for references which are nested inside groups or references which are nested inside other references.

Declared In

BuiltObject.h

– includeReference:onlyFields:

Specifies an array of ‘only’ keys in reference class object that would be included in the response.

- (void)includeReference:(NSString *)key onlyFields:(NSArray *)fieldUIDs

Parameters

key

Key who has reference to some other class object.

fieldUIDs

Array of the ‘only’ reference keys to be included in response.

Discussion

 //Obj-C
 [taskObject includeReference:@[@"project"] onlyFields:@[@"name",@"description"]];

 //Swift
 taskObject.includeReference(["project"], onlyFields:["name","description"])

Specifies an array of keys in reference class object that would be included in the response.

Declared In

BuiltObject.h

– includeReference:excludingFields:

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

- (void)includeReference:(NSString *)key excludingFields:(NSArray *)fieldUIDs

Parameters

key

Key who has reference to some other class object.

fieldUIDs

Array of the ‘only’ reference keys to be ‘excluded’ from the response.

Discussion

 //Obj-C
 [taskObject includeReference:@[@"project"] excludingFields:@[@"description"]];

 //Swift
 taskObject.includeReference(["project"], excludingFields:["description"])

Specifies an array of keys in reference class object that would be ‘excluded’ from the response.

Declared In

BuiltObject.h

Additional Options

– includeOwner

Include the owner’s profile in the objects' data.

- (void)includeOwner

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 //'bltf50esamplefeb' is uid of an object of 'project' class
 BuiltObject *projectObject  = [projectClass objectWithUID:@"bltf50esamplefeb"];
 [projectObject includeOwner];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 //'bltf50esamplefeb' is uid of an object of 'project' class
 var projectObject:BuiltObject = projectClass.objectWithUID("bltf50esamplefeb")
 projectObject.includeOwner()

The returned objects will also contain a key “_owner”, which will include the owner’s profile in the object’s data.

Declared In

BuiltObject.h

– includeCount

Gives object count alongwith the object returned in response.

- (void)includeCount

Discussion

 //Obj-C
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 //'bltf50esamplefeb' is uid of an object of 'project' class
 BuiltObject *projectObject  = [projectClass objectWithUID:@"bltf50esamplefeb"];
 [projectObject includeCount];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 //'bltf50esamplefeb' is uid of an object of 'project' class
 var projectObject:BuiltObject = projectClass.objectWithUID("bltf50esamplefeb")
 projectObject.includeCount()

Gives object count alongwith the object returned in response.

Declared In

BuiltObject.h

Custom Query

– addQueryWithKey:andValue:

Include custom query using a key and a value.

- (void)addQueryWithKey:(NSString *)key andValue:(id)value

Parameters

key

name of the query.

value

value for the query.

Discussion

 //Obj-C
 [projectObject addQueryWithKey:@"query_key" andValue:@"query value"];

 //Swift
 projectObject.addQueryWithKey("query_key", andValue:"query value")

Include custom query using a key and a value.

Declared In

BuiltObject.h

– removeQueryWithKey:

Removes custom query.

- (void)removeQueryWithKey:(NSString *)key

Parameters

key

name of the query.

Discussion

 //Obj-C
 [projectObject removeQueryWithKey:@"query_key"];

 //Swift
 projectObject.removeQueryWithKey("query_key")

Declared In

BuiltObject.h

Upload

– uploadForKey:

Get the info of the specified key of BuiltUpload object and returns instance of BuiltUpload.

- (BUILT_NULLABLE BuiltUpload *)uploadForKey:(NSString *)key

Parameters

key

Key containing the reference value of builtUpload

Return Value

Instance of BuiltUpload.

Discussion

 // 'projectImage' is a key in project class for upload

 //Obj-C
 BuiltUpload *builtUpload = [projectObject uploadForKey:@"projectImage"];

 //Swift
 var builtUpload:BuiltUpload =  projectObject.uploadForKey("projectImage")

Declared In

BuiltObject.h

– uploadsForKey:

Get the array containing instance of BuiltUpload mentioned in key specified.

- (BUILT_NULLABLE NSArray *)uploadsForKey:(NSString *)key

Parameters

key

Key containing the colection reference value of BuiltUpload.

Return Value

Array containing instance of BuiltUpload.

Discussion

 // 'projectImage' is a key in project class for upload

 //Obj-C
 NSArray *builtUploadArray = [projectObject uploadsForKey:@"projectImage"];

 //Swift
 var builtUploadArray = projectObject.uploadsForKey("projectImage")

Declared In

BuiltObject.h

Configure

– configureWithDictionary:

Configure user properties with built object info.

- (void)configureWithDictionary:(NSDictionary *)dictionary

Parameters

dictionary

User Info

Discussion

 //Obj-C
 [projectObject configureWithDictionary:@{@"Key_name":@"MyValue"}];

 //Swift
 projectObject.configureWithDictionary(["Key_name":"MyValue"])

Declared In

BuiltObject.h

Cancel Network calls

– cancelRequests

Advises the operation object that it should stop executing its task.

 //Obj-C
 [projectObject cancelRequests];

 //Swift
 projectObject.cancelRequests()
- (void)cancelRequests

Discussion

This method does not force your operation code to stop. Instead, it updates the object’s internal flags to reflect the change in state. If the operation has already finished executing, this method has no effect. Canceling an operation that is currently in an operation queue, but not yet executing, makes it possible to remove the operation from the queue sooner than usual.

Declared In

BuiltObject.h

LocalStore Methods

– offline

Fetch the object from offline DB.

- (void)offline

Discussion

//Assuming 'projectObject' is a BuiltObject instance

 //Obj-C
 [projectObject offline];
 [projectObject fetch:^(BuiltResponseType responseType, BuiltObject *object, NSError *error) {
    //object is been fetched from offline db
 }];

 //Swift
 projectObject.offline();
 projectObject.fetch { (responseType, object!, error!) -> Void in
    //object is been fetched from offline db
 }

Warning: Not supported in watchOS

Declared In

BuiltObject+LocalStore.h

Realtime Methods

– on:callback:

Registers a event listener on Object in general or in particular depending on implementation.

- (void)on:(BuiltRealtimeEventType)eventType callback:(EventCallback)callback

Parameters

eventType

event types i.e Create/Upate/Delete/Broadcast explained above

callback

response object if success or error object

Discussion

For list of supported events, check BuiltRealtimeEventType

 //ObjC
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject = [projectClass object];

 //just for example we are using BuiltRealtimeEventTypeCreate.
 [projectObject on:BuiltRealtimeEventTypeCreate callback:^(id response, NSError *error) {
     if (error) {
        //some error occured while listening
     }else {
        //BuiltObject instance in response which is recently created
     }
 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()

 //just for example we are using BuiltRealtimeEventType.Create.
 projectObject.on(BuiltRealtimeEventType.Create, callback: { (response, error) -> Void in
     if (error != nil) {
        //some error occured while listening
     }else {
        //BuiltObject instance in response which is recently created
     }
 })

Warning: Not supported in watchOS

Declared In

BuiltObject+Realtime.h

– off:callback:

Unregisters event listener(s) from Object in general or in particular depending on implementation.

- (void)off:(BuiltRealtimeEventType)eventType callback:(EventCallback)callback

Parameters

eventType

Create/Update/Delete/Broadcast

callback

response object if success or error object

Discussion

For list of supported events, check BuiltRealtimeEventType

 //ObjC
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject = [projectClass object];

 //just for example we are using BuiltRealtimeEventTypeCreate.
 [projectObject off:BuiltRealtimeEventTypeCreate callback:^(id response, NSError *error) {
     if (error) {
        //some error occured while unregister
     }
 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()

 //just for example we are using BuiltRealtimeEventType.Create.
 projectObject.off(BuiltRealtimeEventType.Create, callback: { (response, error) -> Void in
     if (error != nil) {
        //some error occured while unregister
     }
 })

Warning: Not supported in watchOS

Declared In

BuiltObject+Realtime.h

– broadcastWithMessage:callback:

Sending a broadcast message to Object in general or in particular depending on implementation.

- (void)broadcastWithMessage:(NSString *)message callback:(EventCallback)callback

Parameters

message

message to broadcast

callback

callback called once broadcast message is send if error occurs error object will be received.

Discussion

 // 'blt5d4sample2633b' is dummy Application API key

 //ObjC
 BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
 BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
 BuiltObject *projectObject = [projectClass object];
 [projectObject broadcastWithMessage:@"Hello world" callback:^(id response, NSError *error) {
     if (error) {
        // error while sending message
     }else {
        // sent broadcast message successfully
     }
 }];

 //Swift
 var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
 var projectClass:BuiltClass = builtApplication.classWithUID("project")
 var projectObject:BuiltObject = projectClass.object()
 projectObject.broadcastWithMessage("Hello World", callback: { (response, error) -> Void in
     if (error != nil) {
        // error while sending message
     }else {
        // sent broadcast message successfully
     }
 })

Warning: Not supported in watchOS

Declared In

BuiltObject+Realtime.h