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


쓴다.



+ Recent posts