Unbox v4.0.0 Release Notes

Release Date: 2019-04-03 // 10 months 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)