class CustomCell_mainMenuCell: UITableViewCell {
let displayName = UILabel()
let img = UIImageView()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
img.image = imageLiteral(resourceName: "temp")
displayName.translatesAutoresizingMaskIntoConstraints = false
displayName.font = UIFont.appRegularFontWith(size: GS.s.commonFontSize)
contentView.addSubview(displayName)
contentView.addSubview(img)
img.snp.makeConstraints {
$0.right.equalToSuperview()
$0.width.equalTo(12)
$0.height.equalTo(GV.s.mainMenu_cell_height)
정의하고,
self.tableView.register(CustomCell_mainMenuCell.self, forCellReuseIdentifier: "titleCell")
등록하고,
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "titleCell", for: indexPath) as! CustomCell_mainMenuCell
cell.displayName.text = GV.s.title_mainMenu[indexPath.row]
cell.value.font = UIFont.appRegularFontWith(size: 17)
cell.value.font = UIFont.appLightFontWith(size: 15)
switch indexPath.row {
case 0:
break
쓴다.
'!A. Basics' 카테고리의 다른 글
changing detail view in MDview (0) | 2019.01.12 |
---|---|
헥사 코드로 컬러 설정하기 (0) | 2019.01.12 |
싱글톤은 최소 2개 이상 (0) | 2019.01.12 |
한번에 여러개의 UIControl 속성을 지정하고 싶을 때 (0) | 2019.01.12 |
Snapkit closure 이해 (0) | 2019.01.07 |