Created
January 3, 2020 06:10
-
-
Save Krishna21Soni13/89ba62a6ae7f0dec943e549b27d17dc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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