Unbox v4.0.0 Release Notes

Release Date: 2019-04-03 // almost 5 years ago
  • 🚚 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)


Previous changes from v3.1.0

  • This version migrates Unbox to Swift 4.2.

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