Skip to content

Instantly share code, notes, and snippets.

@Krishna21Soni13
Created January 3, 2020 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Krishna21Soni13/89ba62a6ae7f0dec943e549b27d17dc4 to your computer and use it in GitHub Desktop.
Save Krishna21Soni13/89ba62a6ae7f0dec943e549b27d17dc4 to your computer and use it in GitHub Desktop.
import Foundation
import UIKit
extension UITableView {
static func emptyCell() -> UITableViewCell {
let cell = UITableViewCell()
cell.selectionStyle = .none
return cell
}
func scrollToBottom(animated: Bool = true) {
DispatchQueue.main.async {
var yOffset: CGFloat = 0.0;
if (self.contentSize.height > self.bounds.size.height) {
yOffset = self.contentSize.height - self.bounds.size.height;
}
self.setContentOffset(CGPoint(x: 0, y: yOffset), animated: animated)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment