UIScrollView-LIFade is a lightweight, fancy and non-intrusive UIScrollView
fade effect category.
- Lightweight: This library contains only 2 files.
- Easy-to-use: Just one line of code can add a fade effect to any of scrollview.
- Non-intrusive: There is no need to make the
UIScrollView
class inherit from other base class. - Category: Works on all of
UIScrollView
includingUITextView
,UITableView
,UICollectionView
orUI/WKWebView
(scrollView), etc.
UIScrollView-LIFade add a fade
property to UIScrollView
witch is a UIEdgeInsets
to represent the fading insets.
#import "UIScrollView+LIFade.h"
UIScrollView *scrollView;
scrollView.fade = UIEdgeInsetsMake(64, 0, 64, 0); //Fade vertically (top 64 and bottom 64)
scrollView.fade = UIEdgeInsetsMake(0, 64, 0, 64); //Fade horizontally (left 64 and right 64)
scrollView.fade = UIEdgeInsetsMake(64, 64, 64, 64); //Fade 4 edges with 64
scrollView.fade = UIEdgeZero; //Remove fade effect
For webview (WKWebView
or UIWebView
)
WKWebView *webView;
webView.scrollView.fade = UIEdgeInsetsMake(64, 0, 64, 0);
To run the example project, clone the repo, and run pod install
from the Example directory first.
Only tested on iOS 8 or higher.
- Add
pod 'UIScrollView-LIFade'
to your Podfile. - Run
pod install
orpod update
.
- Put
UIScrollView+LIFade.h
andUIScrollView+LIFade.m
to your Xcode project.
UIScrollView-LIFade is available under the MIT license. See the LICENSE file for more info.