This code in URBSegmentedControl uses a block that refers to self. The problem is that self will be retained.
[UIView animateWithDuration:0.4 animations:^{
[self layoutSegments];
}];
Instead, it should be something like:
URBSegmentedControl * __weak weakSelf = self;
[UIView animateWithDuration:0.4 animations:^{
URBSegmentedControl * strongSelf = weakSelf;
if (strongSelf) {
[strongSelf layoutSegments];
}
}];
This code in URBSegmentedControl uses a block that refers to self. The problem is that self will be retained.
Instead, it should be something like: