https://github.com/wolfcon/edgeslicker
Hide tab bar or other similar view on edge
https://github.com/wolfcon/edgeslicker
Last synced: over 1 year ago
JSON representation
Hide tab bar or other similar view on edge
- Host: GitHub
- URL: https://github.com/wolfcon/edgeslicker
- Owner: wolfcon
- License: mit
- Created: 2017-05-31T07:21:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T03:00:06.000Z (almost 7 years ago)
- Last Synced: 2025-02-25T09:42:11.901Z (over 1 year ago)
- Language: Objective-C
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EdgeSlicker
Hide tab bar or other similar view on edge
## Todo
1. refactor (less injection)
2. repair the jumping when drag up and down
## Usage
#### Define a var that used to mark the position for slicker.
```objective-c
@property (assign, nonatomic) CGPoint currentScrollOffset;
```
#### ScrollViewDelegate
- scrollViewDidScroll
```objective-c
if ([scrollView isEqual:<#your scroll view responding#>]) {
[<#your Tabbar? or other view#> viewDidRespondAutoHideWhenScrollView:scrollView
beginDraggingContentOffset:self.currentScrollOffset];
}
```
- scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
```objective-c
if ([scrollView isEqual:<#your scroll view responding#>]) {
[<#your Tabbar? or other view#> respondingScrollViewDidEndDragging];
}
```
- scrollViewWillBeginDragging:(UIScrollView *)scrollView {
```objective-c
if ([scrollView isEqual:<#your scroll view responding#>]) {
self.currentScrollOffset = scrollView.contentOffset;
if (scrollView.contentOffset.y < 0) {
self.currentScrollOffset = CGPointZero;
return;
}
}
```