Skip to content

Instantly share code, notes, and snippets.

@Bilguun132
Created February 22, 2019 03:03
Show Gist options
  • Save Bilguun132/830175358b38b9b133ea3b7ca2c6f628 to your computer and use it in GitHub Desktop.
Save Bilguun132/830175358b38b9b133ea3b7ca2c6f628 to your computer and use it in GitHub Desktop.
TableView-Tutorial-TableViewCell.swift
//
// 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