This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (velocity.x > 0) { | |
return NO; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)swipeableCell:(SwipeToPeepCell *)cell didSwipeWithHorizontalPosition:(CGFloat)horizontalPosition progress:(float)progress { | |
self.tableView.scrollEnabled = NO; | |
[self adjustViewBasedOnSwipeProgress:(1-progress)]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer { | |
if ([gestureRecognizer class] == [UIPanGestureRecognizer class]) { | |
CGPoint velocity = [gestureRecognizer velocityInView:nil]; | |
if (fabsf(velocity.x) > fabsf(velocity.y) ) { | |
return YES; | |
} | |
return NO; | |
} | |
return YES; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)adjustViewBasedOnSwipeProgress:(float)progress { | |
self.tableView.alpha = progress; | |
self.tableView.center = CGPointMake(self.view.center.x*progress, self.view.center.y); | |
self.postWebView.center = CGPointMake(self.view.center.x+(self.view.bounds.size.width*progress), self.view.center.y); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)adjustViewBasedOnSwipeProgress:(float)progress { | |
self.tableView.center = CGPointMake(self.view.center.x-(self.view.bounds.size.width*(1-progress)), self.view.center.y); | |
self.postWebView.center = CGPointMake(self.view.center.x+(self.view.bounds.size.width*progress), self.view.center.y); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) { | |
if (progress >= 0.7 || touchVelocity.x < -300) { | |
[self.delegate swipeableCellCompletedSwiping:self]; | |
} else { | |
[self.delegate swipeableCellCancelledSwiping:self]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)adjustViewBasedOnSwipeProgress:(float)progress { | |
self.postWebView.center = CGPointMake(self.view.center.x+(self.view.bounds.size.width*progress), self.view.center.y); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { | |
[self.delegate swipeableCellDidStartSwiping:self]; | |
} else if (gestureRecognizer.state == UIGestureRecognizerStateChanged) { | |
[self.delegate swipeableCell:self didSwipeWithHorizontalPosition:touchLocation.x progress:progress]; | |
} else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) { | |
if (progress >= 0.7) { | |
[self.delegate swipeableCellCompletedSwiping:self]; | |
} else { | |
[self.delegate swipeableCellCancelledSwiping:self]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SVGView.h | |
// Just call the loadSVG method with the SVG's NSData to display it with transparent background & scrollbars. | |
// | |
// github.com/itchingpixels. | |
// | |
#import <UIKit/UIKit.h> | |
@interface SVGView : UIWebView <UIWebViewDelegate> |
NewerOlder