uitableview - iOS Swift How to change or update UILabel attribute in custom UITableViewCell -
i want update/change uilabel attribute (background color,background shape,etc...) dynamically when data web service. i want dispaly label in difference type different lable text, update uilabel attribute according testdata got web server. : if testdata=[1,1,1,1] uilabel background color red , testdata=[2,2,2,2] uilabel background color blue.etc i doing following: in main.stroyboard: i add tableview , tableviewcell (choice custom) associated uitableviewcell named tvcell , add uilabel component. in tvcell import uikit class tvcell: uitableviewcell { @iboutlet weak var testlabel: uilabel! var testdata:testdatainfo?{ didset{ updateui() } } private func updateui(){ if let mfildata=testdata{ setstauteslabel() } } private func setstauteslabel(){ self.testlabel=uilabel(frame: cgrect(x: 50, y: 50, width: 100, height: 35)) self.testlabel.text = "thistestlabel" ...