Skip to content

Releases: leancloud/swift-sdk

16.0.0-beta.8

09 May 02:43
0440e30
Compare
Choose a tag to compare
Merge pull request #197 from zapcannon87/IM

release: 16.0.0-beta.8

16.0.0-beta.7

07 May 07:25
bad41cd
Compare
Choose a tag to compare
Merge pull request #196 from zapcannon87/IM

release: 16.0.0-beta.7

16.0.0-beta.6

05 May 04:30
17d2f54
Compare
Choose a tag to compare
Merge pull request #194 from zapcannon87/IM

release: 16.0.0-beta.6

v16.0.0-beta.5

17 Apr 03:09
b6a1d8a
Compare
Choose a tag to compare
  • fix some bugs, improve stability.

v16.0.0-beta.4

01 Apr 03:11
34667aa
Compare
Choose a tag to compare
Merge pull request #162 from zapcannon87/IM

release: 16.0.0-beta.4

v16.0.0-beta.3

31 Mar 09:52
5b0c894
Compare
Choose a tag to compare
Merge pull request #161 from zapcannon87/IM

release: 16.0.0-beta.3

v16.0.0-beta.2

26 Mar 09:27
36ee73a
Compare
Choose a tag to compare
  • Support Swift 5

v16.0.0-beta.1

11 Mar 10:32
623141c
Compare
Choose a tag to compare

Break changes

  • Support IM

Optimization and fixed bugs

  • Fix LCObject can't modify ivar in some condition

v15.0.0

27 Nov 03:12
4642382
Compare
Choose a tag to compare

This version introduces two following changes:

  • The result error type has been changed from Error to LCError. Error code and description defined in https://leancloud.cn/docs/error_code.html will also be available from result error.
  • We make some Installation properties read-only, and introduce a new method to set these properties in one statement so that it can remind you to set all necessary properties.

v14.0.0

02 Nov 03:59
3941d70
Compare
Choose a tag to compare

LeanCloud Swift SDK 14.0.0 is out! 🚀

The most exciting feature of this version is that you can use dot syntax to get and set object properties without predefining them - in a completely type-safe way. 🎉

Following code snippet demonstrates how to create a book, and set its title and author using dot syntax:

// Create a book.
let book = LCObject(className: "Book")

// Set title and author using dot syntax.
book.title  = "The Elements of Style"
book.author = "William Strunk"

It's a convenient way to create object, but it should not be abused. The recommended way is to predefine a class and properties for book:

/**
 The predefined type for book.
 */
class Book: LCObject {
    /// The book title.
    @objc dynamic var title: LCString?
    /// The book author.
    @objc dynamic var author: LCString?
}

Book.register() // LCObject subclass must register before it is used.

// Create a book.
let book = Book()

// Set title and author by accessing properties.
book.title  = "The Elements of Style"
book.author = "William Strunk"

Another change in this version is that following LCObject instance methods will throw error:

func set(_ key: String, value: LCValueConvertible?) throws
func unset(_ key: String) throws
func increase(_ key: String, by: LCNumberConvertible) throws
func append(_ key: String, element: LCValueConvertible) throws
func append(_ key: String, elements: LCArrayConvertible) throws
func append(_ key: String, element: LCValueConvertible, unique: Bool) throws
func append(_ key: String, elements: LCArrayConvertible, unique: Bool) throws
func remove(_ key: String, element: LCValueConvertible) throws
func remove(_ key: String, elements: LCArrayConvertible) throws
func insertRelation(_ key: String, object: LCObject) throws
func removeRelation(_ key: String, object: LCObject) throws

Above methods will throw error in some cases, you should handle error properly.