| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Component that provide the behavior of hidding a header view while the user makes scroll. It is inspiring in Facebook table scroll style. For sake of simplicity this component follows Behavioral Object Pattern Objc.io.
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like ABMFullScrollBehavior in your projects.
pod "ABMFullScrollBehavior"If you don't want to use cocoapods you just need to copy ABMFullScrollBehavior folder in your project.
In order to apply this behaviour to your scroll based view you just need to follow next steps:
Connect the different IBOutlets:
This object have a couple of IBInspectable properties that you can set from the storyboard:
Most likely you will want your UITableView reacts when the user press a cell and for that you need to use its delegate for instance. But I need it too to know when the user is doing scroll. Fine, let's solve this!
Inside of the component there is another class called ABMMultiplexerProxyBehavior. That is used for connect one delegate and forward every call to every target we connect to it. So the steps would be:
You can provide a delegate for ABMFullScrollBehavior and implement it like the example:
- (void)scroll:(UIScrollView *)scroll animationForHeaderView:(UIView *)view percent:(CGFloat)percent {
[self.headerContainerView setAlpha:percent];
CGFloat transform = MIN(percent+0.5, 1);
[self.headerContainerView setTransform:CGAffineTransformMakeScale(transform, transform)];
}Let's do an small summarize of how is design all the connections between the different objects.
ABMFullScrollBehavior is available under the MIT license. See the LICENSE file for more info.
| Back | FazBrowse Home | New Git URL |