-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTweetCell.swift
49 lines (40 loc) · 1.25 KB
/
TweetCell.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// TweetCell.swift
//
//
// Created by Ben Hass on 2/21/15.
//
//
import UIKit
class TweetCell: UITableViewCell {
@IBOutlet weak var userNameLabel: UILabel!
@IBOutlet weak var userScreenNameLabel: UILabel!
@IBOutlet weak var profileImageView: UIImageView!
@IBOutlet weak var tweetLabel: UILabel!
@IBOutlet weak var timestampLabel: UILabel!
var _tweet: Tweet!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
profileImageView.layer.masksToBounds = true
profileImageView.layer.cornerRadius = 5
profileImageView.userInteractionEnabled = true
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
var tweet: Tweet {
get {
return self._tweet
}
set(tweet) {
self._tweet = tweet
profileImageView.setImageWithURL(tweet.user!.profileImageBiggerUrl)
userNameLabel.text = tweet.user?.name
userScreenNameLabel.text = "@\(tweet.user!.screenName!)"
tweetLabel.text = tweet.text
timestampLabel.text = tweet.timestamp
}
}
}