Skip to content

Commit

Permalink
feat: tableView의 customcell class 생성 (#8)
Browse files Browse the repository at this point in the history
label 업데이트 함수 작성. 후에 수정 필요
  • Loading branch information
Settpark committed Apr 19, 2021
1 parent de65da5 commit 1ee08f0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ios/sidedish/sidedish.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
8214B70B262DE07A004467C2 /* MenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8214B70A262DE07A004467C2 /* MenuCell.swift */; };
82FDB9C7262DCFD8009E3EB7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82FDB9C6262DCFD8009E3EB7 /* AppDelegate.swift */; };
82FDB9C9262DCFD8009E3EB7 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82FDB9C8262DCFD8009E3EB7 /* SceneDelegate.swift */; };
82FDB9CB262DCFD8009E3EB7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82FDB9CA262DCFD8009E3EB7 /* ViewController.swift */; };
Expand All @@ -16,6 +17,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
8214B70A262DE07A004467C2 /* MenuCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuCell.swift; sourceTree = "<group>"; };
82FDB9C3262DCFD8009E3EB7 /* sidedish.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sidedish.app; sourceTree = BUILT_PRODUCTS_DIR; };
82FDB9C6262DCFD8009E3EB7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
82FDB9C8262DCFD8009E3EB7 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -59,6 +61,7 @@
82FDB9C6262DCFD8009E3EB7 /* AppDelegate.swift */,
82FDB9C8262DCFD8009E3EB7 /* SceneDelegate.swift */,
82FDB9CA262DCFD8009E3EB7 /* ViewController.swift */,
8214B70A262DE07A004467C2 /* MenuCell.swift */,
82FDB9CC262DCFD8009E3EB7 /* Main.storyboard */,
82FDB9CF262DCFD8009E3EB7 /* Assets.xcassets */,
82FDB9D1262DCFD8009E3EB7 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -139,6 +142,7 @@
files = (
82FDB9CB262DCFD8009E3EB7 /* ViewController.swift in Sources */,
82FDB9C7262DCFD8009E3EB7 /* AppDelegate.swift in Sources */,
8214B70B262DE07A004467C2 /* MenuCell.swift in Sources */,
82FDB9C9262DCFD8009E3EB7 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
30 changes: 30 additions & 0 deletions ios/sidedish/sidedish/MenuCell.swift
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
}
}
}

0 comments on commit 1ee08f0

Please sign in to comment.