Framework to provide communication to MBaaSKit Server. Provides functionality to send and retrieve objects from server.
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Swift 3
MBaaSKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MBaaSKit"
struct TestObject: TBJSONSerializable {
var name: String!
init() {
}
init(name:String) {
self.name = name
}
init( jsonObject : TBJSON) {
self.name = jsonObject.tryConvert("name")
}
}
var result = [TestObject]()
result.getAllInBackground(ofType:TestObject.self) { (succeeded: Bool, data: [TestObject]) -> () in
DispatchQueue.main.async {
if (succeeded) {
result = data
print("success")
} else {
print("error")
}
}
}
let testObject = TestObject(name: "timothy")
testObject.sendInBackground("objectID"){ (succeeded: Bool, data: NSData) -> () in
DispatchQueue.main.async {
if (succeeded) {
print("scucess")
} else {
print("error")
}
}
}
collegboi, [email protected]
MBaaSKit is available under the MIT license. See the LICENSE file for more info.