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: AnyObjectin topLevelObjects { if (currentObject isUITableViewCell) {                     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), forCellReuseIdentifier: "UploadedPhotoTableCell")             cell = tableView.dequeueReusableCellWithIdentifier("UploadedPhotoTableCell") as? UploadedPhotoTa…