Swift & Objective-C

iOS SDK

SDK Mobile & IoT (iOS)

Create your own iOS applications.

The SDK provides an easy-to-use interface for storing and retrieving data, making it simpler and faster to develop applications.

API to access the data including seamless communication with the cloud service.

share

Code examples

select — query
var qR = container.query(self); if let queryResult = qR { let items:[CBEItem] = queryResult.getItemsSnapshot() as! [CBEItem]; var container:CBEContainer var count:Int = 0 while count < items.count { let item:CBEItem = items[count] //as! CBEItem print("testSDK item \(count) \(String(describing: item)) \(String(describing: item.name()))"); count+=1 } }

 

insert — store object
func onUploadSuccess(_ object: CBEObject!) { NSLog("onUploadSuccess success %@", object.name()); } func onUploadError(_ error: CBEError!, context: CBEContext!) { NSLog("onUploaderror, error: ‰@, context: %@", error, context); } let dataToUpload: Data? = "This is the test data for iOS".data(using: .utf8) myContainer.upload("fileName", length: UInt64(dataToUpload!.count), data: dataToUpload, delegate: self)

 

login with callbacks
func onLog(inSuccess cloudBackend: CloudBackend!) { NSLog("LogIn success "); NSLog("LogIn success account %@", cloudBackend.account()); NSLog("LogIn success account %@ %u", cloudBackend.account().username(), cloudBackend.account().userId()) NSLog("LogIn success container %@", cloudBackend.account().rootContainer()); NSLog("LogIn success container %@", cloudBackend.account().rootContainer()); NSLog("LogIn success container %@", cloudBackend.account().rootContainer().name()); } // onLogSuccess func onLog(inError error: CBEError!, context: CBEContext!) { NSLog("LogIn error "); if let a = error { NSLog("ErrorCode: %u, reason: %@, message: %@", a.errorCode, a.reason, a.message) } if let b = context { NSLog("Function: %@, report: %@", b.fnName, b.report) } } // onLogError // --- Driver Code --- func runTests(){ NSLog("calling login "); let myUsername : String = "abcd"; let myPassword : String = "efgh"; let myTenant : String = "SE1234"; CloudBackend.login(myUsername, password:myPassword, tenant:myTenant, delegate:self); }
 

iOS app data

The cloud database for iPhone, iPad and Mac OS.

phonedatacloud

Cross-platform experience

Seamless exchange of data between Swift and other client platforms.

See more

More information