Skip to content

Voucherify 3.0.0 Migration Guide

polok edited this page Dec 15, 2018 · 4 revisions

Voucherify 3.0.0 is the latest major release of Voucherify, a library for iOS written in Swift. As a major release, following Semantic Versioning conventions, 3.0.0 introduces several API-breaking changes that one should be aware of.

This guide is provided in order to ease the transition of existing applications using Voucherify 2.x to the latest APIs, as well as explain the design and structure of new and changed functionality.

Requirements

Voucherify 3.0.0 officially supports iOS 9+, Xcode 10 and Swift 4.2.

Breaking API Changes

Voucherify 3.0.0 contains some breaking API changes to the foundational classes of validations and redemptions. It is really important to understand how these changes affect the common usage patterns.

Validations

For those wishing to validate a voucher, you'll need to skip vouchers() method on voucherify client object and call voucher's validation methods on validations field.

Instead

client.vouchers().validations().validateVoucher(...) {}

Use

client.validations.validateVoucher(...) {}

Redemptions

For those wishing to redeem a voucher, you'll need to skip vouchers() method on voucherify client object and call voucher's redeem methods on redemptions field.

Instead

client.vouchers().redeemptions().redeem(...) {}

Use

client.redemptions.redeem(...) {}
Clone this wiki locally