NSScreencast Episode #97 Scrolling Nub
スクロールバーの実装
- dropbox app, instapaper (example)
- grabbable
- highlight when grabbed
- loadView (<UITableViewDataSource, UITableViewDelegate>)
- scrollingNub initWithFrame
- self.scrollingNub.layer.cornerRadius = 12;
- self.scrollingNub.alpha = 0;
- [self.view addSubview:self.scrollingNub];
- UIPanGestureRecognizer
- action:@selector(onNubScrub:)
- onNubScrub
- Math
- BUGFIX: Use negative value
- CGFloat minOffset = - self.tableView.contentInset.top;
- BUGFIX: Use negative value
- self.scrubbing = YES/NO
- [pan translationInView:self.view].y
- [self.tableView setContentOffset:offset];
- [pan setTranslation:CGPointZero inView:self.view];
- Math
- animateNumbAlpha
- hideNubAfterDelay
- dispatch_after
- scrollViewDidScroll
- [self repositionNub];
- scrollViewDidEndDragging
- [self hideNubAfterDelay];
- scrollViewDidEndDecelerating
- [self hideNubAfterDelay];
- percentageThroughContent
- nubY
- bounce at the bottom