Last active
          August 29, 2015 14:14 
        
      - 
      
- 
        Save tmm/53feb0c52f76ba6d9f9d to your computer and use it in GitHub Desktop. 
Revisions
- 
        tmm renamed this gist May 6, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        tmm renamed this gist Feb 3, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        tmm created this gist Feb 3, 2015 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ // Option 1 - For portrait orientation only override func viewDidLoad() { super.viewDidLoad() tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = 160.0 } // Option 2 - For both portrait and landscape orientations override func viewDidLoad() { super.viewDidLoad() tableView.rowHeight = UITableViewAutomaticDimension } func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { if isLandscapeOrientation() { return hasImageAtIndexPath(indexPath) ? 140.0 : 120.0 } else { return hasImageAtIndexPath(indexPath) ? 235.0 : 155.0 } }