Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Unbox 4.0.0

Latest
Compare
Choose a tag to compare
@JohnSundell JohnSundell released this 03 Apr 15:31
· 3 commits to master since this release
d837dd4

This version moves Unbox to Xcode 10.2 and Swift 5, and with that comes some API changes that will require manual fixes for users adopting this new version.

Since Swift now automatically flattens optionals returned from throwing functions called with try?, Unbox now uses throwing APIs for all unboxing methods. That means that while in previous versions, you’d unbox an optional property like this:

struct User: Unboxable {
    var name: String?
    
    init(unboxer: Unboxer) throws {
        name = unboxer.unbox(key: "name")
    }
}

You’ll now have to prefix such calls with try?:

struct User: Unboxable {
    var name: String?
    
    init(unboxer: Unboxer) throws {
        name = try? unboxer.unbox(key: "name")
    }
}

While I realize that the above change brings a slight regression in terms of Unbox’s ease-of-use, it’s necessary in order to make Unbox support the latest Swift tools within a reasonable scope, and also moves Unbox's API to be more inline with modern Swift conventions for throwing methods.

View build details and download artifacts on buddybuild:
Unbox (iOS, Unbox-iOS)