Skip to content

Instantly share code, notes, and snippets.

Mark Dominick Flores mdflores

  • Asurion HongKong Limited - ROHQ
Block or report user

Report or block mdflores

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mdflores
mdflores / tableViewScrollToBottom.swift
Last active Jan 3, 2019
Safe Scroll To Bottom in TableView using Content Height
View tableViewScrollToBottom.swift
extension UITableView {
func scrollToBottom(animated: Bool) {
let scrollPoint = CGPoint(x: 0, y: self.contentSize.height - self.frame.size.height)
self.setContentOffset(scrollPoint, animated: animated)
}
}
@mdflores
mdflores / RevokableTask.swift
Last active Apr 2, 2018
RevokableTask adds a task delayed to the main queue which can be revoked or cancelled.
View RevokableTask.swift
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
You can’t perform that action at this time.