Releases: leancloud/swift-sdk
Releases · leancloud/swift-sdk
16.0.0-beta.8
Merge pull request #197 from zapcannon87/IM release: 16.0.0-beta.8
16.0.0-beta.7
Merge pull request #196 from zapcannon87/IM release: 16.0.0-beta.7
16.0.0-beta.6
Merge pull request #194 from zapcannon87/IM release: 16.0.0-beta.6
v16.0.0-beta.5
- fix some bugs, improve stability.
v16.0.0-beta.4
Merge pull request #162 from zapcannon87/IM release: 16.0.0-beta.4
v16.0.0-beta.3
Merge pull request #161 from zapcannon87/IM release: 16.0.0-beta.3
v16.0.0-beta.2
- Support Swift 5
v16.0.0-beta.1
Break changes
- Support IM
Optimization and fixed bugs
- Fix LCObject can't modify ivar in some condition
v15.0.0
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
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.