Last active
June 3, 2016 05:00
-
-
Save pingzh/21213806d4aa94e60839 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private let _refreshControl: UIRefreshControl! | |
//in addSubviews | |
tableView.addSubview(refreshControl) | |
func refreshView() { | |
refreshControl.beginRefreshing() | |
tableView.reloadData() | |
//initData() | |
refreshControl.endRefreshing() | |
} | |
extension xxxxx: UIViewController { | |
var refreshControl: UIRefreshControl { | |
if _refreshControl == nil { | |
_refreshControl.tintColor = UIColor.grayColor() | |
_refreshControl.addTarget(self, action: "refreshView", forControlEvents: .ValueChanged) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment