Skip to content

Commit

Permalink
Fixes -Wfloat-equal error
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedc committed Dec 8, 2012
1 parent 0adf998 commit b840cc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SVPullToRefresh/UIScrollView+SVPullToRefresh.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#import <QuartzCore/QuartzCore.h>
#import "UIScrollView+SVPullToRefresh.h"

//fequalzro() from http:https://stackoverflow.com/a/1614761/184130
#define fequalzero(a) (fabs(a) < FLT_EPSILON)

static CGFloat const SVPullToRefreshViewHeight = 60;

Expand Down Expand Up @@ -424,7 +426,7 @@ - (void)triggerRefresh {
}

- (void)startAnimating{
if(self.scrollView.contentOffset.y == 0) {
if(fequalzero(self.scrollView.contentOffset.y)) {
[self.scrollView setContentOffset:CGPointMake(self.scrollView.contentOffset.x, -self.frame.size.height) animated:YES];
self.wasTriggeredByUser = NO;
}
Expand Down

0 comments on commit b840cc5

Please sign in to comment.