Hi guys,
I'll tell you my issue. After call to "setContentOffset" in my UITableView
self.tableView!.setContentOffset(CGPointMake(0, -227.5), animated: false)
when I begin a drag gesture over my UITableView the contentOffset is the same (0, -227.5) in delegate method "scrollViewWillEndDragging" but after in method "scrollViewDidScroll" the first contentOffset is very different, approximately (0, -152.5).
It shows a weird effect. The UITableView jumps sharply from point (0, -227.5) to (0, -152.5).
I attach a simple example code with the above problem:
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
/
self.tableView!.contentInset = UIEdgeInsetsMake(82.5, 0, 0, 0)
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
self.tableView!.setContentOffset(CGPointMake(0, -227.5), animated: true)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
/
}
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
return cell
}
}
Any help?
Regards.