You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tianyong Tang edited this page Jun 1, 2016
·
2 revisions
After installation, you can experience LeanCloud Swift SDK now.
Firstly, you need create an LeanCloud application at LeanCloud Console.
Use the application ID and application key to initialize LeanCloud Swift SDK in AppDelegate.swift:
/* Use application ID and application key to initialize SDK. */
LeanCloud.initialize(applicationID: YOUR_APPLICATION_ID, applicationKey: YOUR_APPLICATION_KEY)
Then, you can enjoy service of LeanCloud. Let us save an object to LeanCloud application. Put following code in proper place:
/* Create an object. */
letobject=LCObject()
/* Save the object to LeanCloud application. */
object.save{ result inswitch result {case.Success:print("Success")case.Failure:print("Failure")}}
Build and run application. If everything is OK, the object is successfully saved to LeanCloud application.