title: iOS scroll view disable auto scroll to top
body: <p>I'm new to iOS development so this should probably be a easy question for someone.
  I am creating a scrollview (tried different ways, UIScrollView, UITableView, UITableViewController) and everytime i scroll down it scrolls back up to the top automatically. Why does this happen?</p>
  
  <p>I understand "scrollsToTop" is listening for some guesture to scroll to top but that is set to NO so should not be that.
  "pagingEnabled" have been tested to be YES and NO but does not have an impact.</p>
  
  <p>Tried to implement a UITableViewDelegate and override the scrollViewShouldSrollToTop function and return NO but the function is never called even though it is set as delegate of the tableView.</p>
  
  <pre><code>@interface Scroller : NSObject&lt;UITableViewDelegate&gt;
  
  @implementation
  - (BOOL)scrollViewShouldScrollToTop:(UIScrollView )scrollView {return NO;}
  
  // Did finish launching application
  tableView = [[UITableView alloc] initWithFrame:tableRect style:UITableViewStyleGrouped];
  self-&gt;tableView.pagingEnabled = NO;
  tableView.scrollsToTop = NO;
  [tableView setScrollsToTop:NO]; 
  static Scroller s = [[Scroller alloc] init];
  tableView.delegate = s;
  </code></pre>
  
  <p>Dont mind the formatting. It's all a mess. 
  tableView belongs to the application delegate and is called in the ..didFinishLaunchingWithOptions:... function.
  I have a breakpoint in the Scroller function "scrollViewShouldScrollToTop" but it is never hit.</p>