nil delegates

This commit is contained in:
Hailey
2025-05-11 12:42:15 -07:00
parent 33250f9a65
commit 7c587bd98b
@@ -79,6 +79,10 @@ static const CGFloat kMinimumVelocity = 5.0;
[self stopAnimation]; [self stopAnimation];
[self removeCancelGestureRecognizers]; [self removeCancelGestureRecognizers];
_svcv = nil; _svcv = nil;
for (UIGestureRecognizer *gr in self.gestureRecognizers) {
gr.delegate = nil;
}
} }
- (void)prepareForRecycle - (void)prepareForRecycle
@@ -172,10 +176,8 @@ static const CGFloat kMinimumVelocity = 5.0;
- (void)stopAnimation - (void)stopAnimation
{ {
[self disableCancelGestureRecognizers]; [self disableCancelGestureRecognizers];
if (_displayLink) { [_displayLink invalidate];
[_displayLink invalidate]; _displayLink = nil;
_displayLink = nil;
}
} }
- (void)handlePan:(UIPanGestureRecognizer *)gesture { - (void)handlePan:(UIPanGestureRecognizer *)gesture {
@@ -186,6 +188,8 @@ static const CGFloat kMinimumVelocity = 5.0;
CGPoint translation = [gesture translationInView:self]; CGPoint translation = [gesture translationInView:self];
if (gesture.state == UIGestureRecognizerStateBegan) { if (gesture.state == UIGestureRecognizerStateBegan) {
_didImpact = false;
if (sv.contentOffset.y < 0) { if (sv.contentOffset.y < 0) {
CGPoint newOffset = CGPointMake(sv.contentOffset.x, 0); CGPoint newOffset = CGPointMake(sv.contentOffset.x, 0);
sv.contentOffset = newOffset; sv.contentOffset = newOffset;
@@ -207,7 +211,6 @@ static const CGFloat kMinimumVelocity = 5.0;
if (gesture.state == UIGestureRecognizerStateEnded) { if (gesture.state == UIGestureRecognizerStateEnded) {
CGPoint velocity = [gesture velocityInView:self]; CGPoint velocity = [gesture velocityInView:self];
_didImpact = false;
if (sv.contentOffset.y <= -kPullThreshold) { if (sv.contentOffset.y <= -kPullThreshold) {
[self refresh]; [self refresh];