CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Masashi Ono.
AKInteractiveBarProxy library provides a proxy object which helps you to make Safari-like interactive animation bars on UIScrollView. The proxy works as a delegate object for UIScrollView and its subclasses to interact with user inputs. Once user scrolls around on the scroll view, AKInteractiveBarProxy analyse scroll gestures and parse it to its delegate as an interactive animation.
CocoaPods (NOT YET AVAILABLE)
Instanticate AKInteractiveBarProxy with your scroll view.
// Instaciate the target scroll view (or subclasses of scroll view, like table view).
self.scrollView = [[UIScrollView alloc] initWithFrame:self.contentView.bounds];
[self.contentView addSubView:scrollView];
// Provide a proxy
// interactionTranslation defines how far users have to pan before interaction is complete.
self.interactiveBarProxy = [[AKInteractiveBarProxy alloc] initWithScrollView:self.scrollView
delegate:self];
self.interactiveBarProxy.interactionTranslation = 64.0;
Once setup is done, implement delegate methods for the proxy. You can also implement UIScrollViewDelegate as well since AKInteractiveBarProxyDelegate confirms UIScrollViewDelegate.
// Implement delegate methods
- (void)proxy:(AKInteractiveBarProxy *)proxy receivedInteractiveGestureWithProgress:(CGFloat)progress
{
// This delegate is called when the proxy detects interactive gestures.
// Implement your interactive animation here.
// Note this method is gets called until user stops interactions.
// progress 0.0 = Your bar should be completely hidden
// progress 1.0 = Your bar should be completely visible
self.bar.alpha = progress;
}
- (void)proxy:(AKInteractiveBarProxy *)proxy receivedNonInteractiveActionWithBarHidden:(BOOL)hidden
{
// This delegate is called when the proxy detects non-interactive onetime actions.
// You should programmatically show/hide your views here.
[self.bar setHidden:hidden animated:YES];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
// This will also gets called. Do anything you want!
}