I had an issue with CCBottomRefreshControl when running in a test target, where the swizzled method gets called in an endless loop. Further investigation showed that load was called two times with my test target only.
Ultimately, the issue for that was a different one, but nonetheless, the swizzling in the load methods should get protection from being called multiple times.
Please wrap the swizzling in every load in a
static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{
Also, consider using JRSwizzle (probably no one should ever re-implement swizzling on their own).
I had an issue with CCBottomRefreshControl when running in a test target, where the swizzled method gets called in an endless loop. Further investigation showed that load was called two times with my test target only.
Ultimately, the issue for that was a different one, but nonetheless, the swizzling in the load methods should get protection from being called multiple times.
Please wrap the swizzling in every load in a
static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{
Also, consider using JRSwizzle (probably no one should ever re-implement swizzling on their own).