MBaaSKit 0.2.8.28.4

MBaaSKit 0.2.8.28.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2017
SwiftSwift Version 3.1
SPMSupports SPM

Maintained by Timothy Barard--description=Framework for communicating with MBaaSKit Server.



MBaaSKit 0.2.8.28.4

  • By
  • collegboi

Description

Framework to provide communication to MBaaSKit Server. Provides functionality to send and retrieve objects from server.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 3

Installation

MBaaSKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MBaaSKit"

Usage

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")
        }
    }
}

Author

collegboi, [email protected]

License

MBaaSKit is available under the MIT license. See the LICENSE file for more info.