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
extension UITableView { | |
func scrollToBottom(animated: Bool) { | |
let scrollPoint = CGPoint(x: 0, y: self.contentSize.height - self.frame.size.height) | |
self.setContentOffset(scrollPoint, animated: animated) | |
} | |
} |
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
typealias TaskHandler = () -> () | |
class RevokableTask { | |
private(set) var isCancelled: Bool = false | |
private(set) var task: TaskHandler | |
private(set) var delayTime: DispatchTime | |
private(set) var identifier: String | |
init(delayInSeconds: Double, task: @escaping TaskHandler) { | |
self.task = task |