Created
February 22, 2019 03:03
-
-
Save Bilguun132/830175358b38b9b133ea3b7ca2c6f628 to your computer and use it in GitHub Desktop.
TableView-Tutorial-TableViewCell.swift
This file contains 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
// | |
// UserView.swift | |
// TableViewDemo | |
// | |
// Created by Bilguun Batbold on 22/2/19. | |
// Copyright © 2019 ISEM. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
class UserTableViewCell: UITableViewCell { | |
//declare the outlets | |
@IBOutlet weak var nameLabel: UILabel! | |
@IBOutlet weak var genderLabel: UILabel! | |
@IBOutlet weak var emailLabel: UILabel! | |
//setup the outlets however we want onces it's been init | |
override func awakeFromNib() { | |
nameLabel.font = UIFont.boldSystemFont(ofSize: 14) | |
genderLabel.font = UIFont.systemFont(ofSize: 14, weight: .light) | |
emailLabel.font = UIFont.systemFont(ofSize: 14, weight: .light) | |
} | |
//add function to configure and set the texts | |
func configure(user: User){ | |
nameLabel.text = user.name | |
genderLabel.text = user.gender | |
emailLabel.text = user.email | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment