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.
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. Thex
amount of targets caused the delegate to be called multiple times which caused the crash.Testing Plan
Tested manually with obj-c example app.