a uitableviewcell's detailtextlabel should optional, documented, why textlabel property optional?
short answer: save resources. textlabel property optional allow uilabel lazily initialized. in other words, property stays nil unless attempt access it.
you can verify in debugger examining instance of uitableviewcell:
let cell = dequeuereusablecellwithidentifier(mycell.cellidentifier, forindexpath: indexpath) as! mycell // check cell.textlabel here in debugger. should nil. cell.textlabel.text = "test" // creates textlabel via lazy initialization
Comments
Post a Comment