1

I have an app that runs perfectly on iOS 9 (simulator) with Swift 2.0 and have an older version of the app with the old version of Swift that runs perfectly on iOS 8.3 (device). For some odd reason, running the Swift 2.0 version on iOS 8.3 causes some weird bugs which really shouldn't be there. Most notably, the UITableView backgroundColor shows up as black instead of white even though it is specifically set as white in Storyboard. Additionally the following code does nothing to modify the height of a table view cell pre iOS 9 even though it's nothing new:

override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        if (indexPath.row == 0) {
            //calculating the height of the cell
            return self.description.frame.height+28+40
        }
        return super.tableView(tableView, heightForRowAtIndexPath: indexPath)
    }

Any insight would be greatly appreciated.

cyril
  • 3,020
  • 6
  • 36
  • 61
  • I'm guessing the programming language is a red herring. It could be a bug in the iOS 9 SDK's ability to run on iOS 8 devices. See if you can reproduce this in a basic sample app, and if so, upload it here (or [file a bug report](http://bugreport.apple.com) if you're sure it's not your fault). – Aaron Brager Jun 16 '15 at 13:38
  • I'm leaning toward a bug in the SDK for iOS 9. Swift itself isn't bug-free either. See some weird things I have discovered: http://stackoverflow.com/questions/30633829/multiline-statement-in-swift and http://stackoverflow.com/questions/30830713/differences-between-playground-and-project – Code Different Jun 16 '15 at 14:16
  • I've got the same problem. I'm stil looking. For now, you could add those ligne in the numberOfRowInSection method: tableView.rowHeight = UITableViewAutomaticDimension tableView.estimatedRowHeight = CGFloat(*your magic number*) – Alex Milousse Apr 22 '16 at 07:22

0 Answers0