swift - When i try to apply "Font" to one tableview cell it automatically apply to other cells when scroll tableview -


i have custom tableview.

i need set bold italic (helvetica-boldoblique) font cell.but when scroll tableview apply other cells 1 one.how solve this?

    func applyfonttotableviewcell() {      var couin = nsindexpath(forrow: 2, insection: 0)     var coucell = colortableview.cellforrowatindexpath(couin)     coucell?.textlabel?.font = uifont(name: "helvetica-boldoblique", size: 18.0)       } 

i tried same code in cellforrowatindexpath also.but same issue occured.

thanks in advance.

you can applied bold font on alternative cell bellowed way.

 func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {             let coucell = tableview.dequeuereusablecellwithidentifier(textcellidentifier, forindexpath: indexpath) uitableviewcell              let row = indexpath.row              if row == 2 || row == 4 || row == 6 {               coucell?.textlabel?.font = uifont(name: "helvetica-boldoblique", size: 18.0)            }           else{                coucell?.textlabel?.font = uifont(name: "helvetica", size: 18.0)            }              return cell         } 

hope you.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -