SectionedSlider
SectionedSlider copied to clipboard
Fix delegate reference cycle (memory leak) and upgrade to swift 5.0
Hey,
I've separated the content to 4 commits:
- Upgrade Swift 3.0 -> 4.2
- Upgrade Swift 4.2 -> 5.0
- Change the Example project to have a navigation controller leading to the view controller, so it's easy to show the leak
- Fix the leak
To reproduce:
- Go to the 3rd commit and run the example
- Enter the slider VC, then back out, repeat a couple of times
- Use Xcode's "Debug Memory Graph"
You'll see that there are multiple ViewControllers up, rather than one:

The 4th commit fixes this. More info on delegates and retains cycles here.
Hope you can approve this PR and update the Pod!