Skip to content

swifty-tim/MBaasKitTest

Repository files navigation

MBaasKitTest

Description

Demonstrating how the pod MBaasKit works

Requirements

  • Swift 3
  • Xcode 8.2.1

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

Screenshots

Image 1

Image 2

Image 3

Author

Timothy Barnard

License

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

About

Mobile Backend as a Service Test Project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published