getbouncer / cardscan-ios

A library for scanning credit and debit cards
MIT License
207 stars 66 forks source link

Added fix to manually remove target #283

Closed jaimepark-stripe closed 3 years ago

jaimepark-stripe commented 3 years ago

Summary

Manually removed the buttons targets at the end of lifecycle due to possible strong referenced custom buttons.

Motivation

Afterpay engineer found a bug where after the first open to the view controller, the subsequent calls would cause the app to crash. This is because the custom buttons were strongly referenced and on every subsequent call a new action would be added to the buttons on every setUpUi() call. The x amount of targets caused the delegate to be called multiple times which caused the crash.

Testing Plan

Tested manually with obj-c example app.