Created
August 6, 2016 06:38
-
-
Save niwatako/42c5d19424afb2fd9235d3d992068370 to your computer and use it in GitHub Desktop.
viewDidLoad で 引っ張られた時に refresh() 処理を行うようにする。 #CodePiece #realm_swift #realm_jp
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
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