Skip to main content

Posts

Showing posts from March, 2016

Load custom table view cell from xib if it contains multiple views

  var cell : UploadedPhotoTableCell !=tableView. dequeueReusableCellWithIdentifier ( "UploadedPhotoTableCell" ) as ? UploadedPhotoTableCell                  if cell == nil         {             let topLevelObjects: [ AnyObject ] = NSBundle . mainBundle (). loadNibNamed ( "UploadedPhotoTableCell" , owner: self , options: nil )             for currentObject: AnyObject in topLevelObjects {                 if (currentObject is UITableViewCell ) {                     cell = currentObject as ! UploadedPhotoTableCell                 }             }         } // It it UITableViewCell class contains only one view i.e content view    var cell : UploadedPhotoTableCell !=tableView. dequeueReusableCellWithIdentifier ( "UploadedPhotoTableCell" ) as ? UploadedPhotoTableCell                  if cell == nil         {             tableView. registerNib ( UINib (nibName: "UploadedPhotoTableCell" , bundle: nil ),