Skip to content

Instantly share code, notes, and snippets.

@niwatako
Created August 6, 2016 06:38
Show Gist options
  • Save niwatako/42c5d19424afb2fd9235d3d992068370 to your computer and use it in GitHub Desktop.
Save niwatako/42c5d19424afb2fd9235d3d992068370 to your computer and use it in GitHub Desktop.
viewDidLoad で 引っ張られた時に refresh() 処理を行うようにする。 #CodePiece #realm_swift #realm_jp
override func viewDidLoad() {
// 略
refreshControl?.addTarget(self, action: #selector(TimelineViewController.refresh(_:)), forControlEvents: .ValueChanged)
}
func refresh(sender: UIRefreshControl) {
if let _ = self.account {
getHomeTimeline()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment