quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

NSScreencast Episode #97 Scrolling Nub

Scrolling Nub - NSScreencast

スクロールバーの実装

  • 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;
    • self.scrubbing = YES/NO
    • [pan translationInView:self.view].y
    • [self.tableView setContentOffset:offset];
    • [pan setTranslation:CGPointZero inView:self.view];
  • animateNumbAlpha
  • hideNubAfterDelay
    • dispatch_after
  • scrollViewDidScroll
    • [self repositionNub];
  • scrollViewDidEndDragging
    • [self hideNubAfterDelay];
  • scrollViewDidEndDecelerating
    • [self hideNubAfterDelay];
  • percentageThroughContent
  • nubY
  • bounce at the bottom