0

I realize that this is generic question. I asked a specific question and did not get a reply.

https://stackoverflow.com/questions/40854131/collection-view-ios-8-bug

In your experience as an iOS developer, what could be cause of different behavior in iOS 8 and iOS 9 for same code. I have a bug that I can't figure out and I was looking for reasons which might lead to different behavior for same code.

I suspect that I might be using a feature that is not available in iOS 8, but is avaliable in iOS 9, but won't xcode, warn me if I do this ?

What are some cases where you have faced this in your code-base ?

Could it be because I am using swift and ios 8 does on support it well enough ?

I can't figure out the reason why this might happen.

Community
  • 1
  • 1
nnrales
  • 1,481
  • 1
  • 17
  • 26

1 Answers1

2

what could be cause of different behavior in iOS 8 and iOS 9 for same code

It has nothing to do with Swift. The cause would be that iOS 8 is not iOS 9 (and vice versa). That means exactly that they might not respond identically to the same code. It has nothing to do with features being available or not. One and the same API can behave differently from system to system. That's just a fact you need to get used to.

Just to give some rudimentary examples (these are just some of the many problems I have banged into in the past):

  • Setting a UIProgressView's progressImage works in iOS 6, has no effect in iOS 8, and works in iOS 9.

  • Setting a UIBarButtonItem's possibleTitles works in iOS 8 but has no effect in iOS 9.

  • Automatic loading of an eponymous nib doesn't work in Swift code in iOS 8 but it does work in iOS 9 (see for my example my answer here).

  • UISwitch onImage and offImage work in iOS 6 but in no systems after that — though they have never been deprecated or removed from the API.

  • CNContactViewController forUnknownContact destroys the interface in iOS 9 but works in iOS 10.

Programming for multiple systems is hard. This kind of undocumented misbehavior is an example of why. Do not expect the same code to work the same way in different systems.

(The same code can even give different results between minor version updates. In this answer I discuss a problem that arises only in iOS 8.3.)

Community
  • 1
  • 1
matt
  • 515,959
  • 87
  • 875
  • 1,141