-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tableView의 customcell class 생성 (#8)
label 업데이트 함수 작성. 후에 수정 필요
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// MenuCell.swift | ||
// sidedish | ||
// | ||
// Created by 박정하 on 2021/04/19. | ||
// | ||
|
||
import UIKit | ||
|
||
class MenuCell : UITableViewCell { | ||
@IBOutlet weak var menuImage: UIImageView! | ||
|
||
@IBOutlet weak var menuTitle: UILabel! | ||
@IBOutlet weak var menuSubTitle: UILabel! | ||
@IBOutlet weak var reducedPrice: UILabel! | ||
@IBOutlet weak var menuPrice: UILabel! | ||
@IBOutlet weak var specialPrice: UILabel! | ||
|
||
func updateMenu(titleText: String, subTitle: String, reducedPrice: String, price: String, isSpecialPrice: Bool){ | ||
self.menuTitle.text = titleText | ||
self.menuSubTitle.text = subTitle | ||
self.reducedPrice.text = reducedPrice | ||
self.menuPrice.text = price | ||
self.specialPrice.isHidden = isSpecialPrice | ||
|
||
if isSpecialPrice { | ||
menuPrice.isHidden = true | ||
} | ||
} | ||
} |