uitableview - Swift: How can I get the UItextlabel from headerViewer -
i need string set in headerview of row selected. need information decide view row send to. allready have row name. need aswell name of string used in headerview.
follow steps
take array of section header name , declare above viewdidload methods
let sectionheaderarray = ["header1", "header2"]implement method view section header
func tableview(tableview: uitableview, willdisplayheaderview view: uiview, forsection section: int) { let header = view as! uitableviewheaderfooterview header.textlabel?.text = self.sectionheaderarray[section] }in diddeselectrowatindexpath method can section name
func tableview(tableview: uitableview, diddeselectrowatindexpath indexpath: nsindexpath) { let section_name = self.sectionheaderarray[indexpath.section] }
hope you.
Comments
Post a Comment