-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBusinessListTableViewCell.swift
55 lines (41 loc) · 1.51 KB
/
BusinessListTableViewCell.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
50
51
52
53
54
55
//
// BusinessListTableViewCell.swift
// Yelp
//
// Created by Nilesh Agrawal on 9/26/15.
// Copyright © 2015 Timothy Lee. All rights reserved.
//
import UIKit
class BusinessListTableViewCell: UITableViewCell {
@IBOutlet weak var thumbImageView: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var distanceLabel: UILabel!
@IBOutlet weak var ratingsImageView: UIImageView!
@IBOutlet weak var reviewsCountLabel: UILabel!
@IBOutlet weak var foodListLabel: UILabel!
@IBOutlet weak var AddressLabel: UILabel!
var business:Business!{
didSet{
thumbImageView.setImageWithURL(business.imageURL)
nameLabel.text = business.name
distanceLabel.text = business.distance
AddressLabel.text = business.address
reviewsCountLabel.text = "\(business.reviewCount!) Reviews"
ratingsImageView.setImageWithURL(business.ratingImageURL)
foodListLabel.text = business.categories
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
thumbImageView.layer.cornerRadius = 5.0
thumbImageView.clipsToBounds = true
nameLabel.preferredMaxLayoutWidth = nameLabel.frame.size.width
}
override func layoutSubviews() {
super.layoutSubviews()
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
}