-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathPullRequestTableViewCell.swift
More file actions
35 lines (27 loc) · 1.12 KB
/
PullRequestTableViewCell.swift
File metadata and controls
35 lines (27 loc) · 1.12 KB
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
//
// PullRequestTableViewCell.swift
// Git Java
//
// Created by Filipe Amaral Neis on 29/08/2018.
// Copyright © 2018 Neis. All rights reserved.
//
import UIKit
import Kingfisher
class PullRequestTableViewCell: UITableViewCell {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var bodyLabel: UILabel!
@IBOutlet weak var userNameLabel: UILabel!
@IBOutlet weak var avatarUserImageView: UIImageView!
@IBOutlet weak var createdAtLabel: UILabel!
@IBOutlet weak var updateAtLabel: UILabel!
func setupCell(pullRequest: PullRequest) {
let viewModel = PullRequestViewModel(pullRequest: pullRequest)
self.titleLabel.text = viewModel.title
self.bodyLabel.text = viewModel.body
self.createdAtLabel.text = String(format: "%@%@" , "Criado: " ,viewModel.createdAt)
self.updateAtLabel.text = String(format: "%@%@" , "Atualizado: " ,viewModel.updateAt)
self.userNameLabel.text = viewModel.user.login
self.avatarUserImageView.kf.setImage(with: URL(string: viewModel.user.avatarUrl))
self.avatarUserImageView.round()
}
}