Created
July 11, 2016 19:21
-
-
Save jugyo/0f5e3e32db22d70c87070836f9173060 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 { | |
// NOTE: Workaround for the broblem of iOS8 when using UITableViewAutomatic Dimension. http://stackoverflow.com/questions/25589540/uitableview-refresh-without-scrolling | |
func reloadDataWithKeepingContentOffset() { | |
let prevContentOffset = contentOffset | |
reloadData() | |
layoutIfNeeded() | |
contentOffset = prevContentOffset | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment