Skip to content

Instantly share code, notes, and snippets.

@willrichman
Created October 9, 2014 21:57
Show Gist options
  • Save willrichman/1df23c53f528ff09c0d8 to your computer and use it in GitHub Desktop.
Save willrichman/1df23c53f528ff09c0d8 to your computer and use it in GitHub Desktop.
Gesture recognizer on my profile image
override func viewWillAppear(animated: Bool) {
self.singleTweetUserName.text = self.tweetShown!.profileName
self.singleTweetTwitterHandle.text = ("@\(self.tweetShown!.screenName)")
self.singleTweetText.text = self.tweetShown!.text
self.singleTweetProfileImage.image = self.tweetShown!.profileImage
self.singleTweetFavoritesCount.text = String(self.tweetShown!.favoriteCount)
self.singleTweetRTsCount.text = String(self.tweetShown!.retweetCount)
let press = UITapGestureRecognizer(target: self, action: Selector("segueAction:"))
self.singleTweetProfileImage.addGestureRecognizer(press)
}
func segueAction(recognizer: UITapGestureRecognizer) {
let userTimelineVC = self.storyboard?.instantiateViewControllerWithIdentifier("TIMELINE_VC") as HomeTimeLineViewController
let userToDisplay = tweetShown?.screenName
userTimelineVC.userTimelineShown = userToDisplay
userTimelineVC.timelineType = "USER"
self.navigationController?.pushViewController(userTimelineVC, animated: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment