hamobi
hamobi

Reputation: 8130

SpriteKit - why does my game develop bugs as new iOS versions are released?

How does spritekit actually work? Is the frameworks code compiled into the app or is it part of iOS itself. I notice every time theres a major update to iOS I find myself having to rewrite a bunch of code and fix bugs in my spritekit game. Why is that?

Upvotes: 3

Views: 84

Answers (2)

Steve Ives
Steve Ives

Reputation: 8134

The SpriteKit run-time environment is on the phone, not part of your app. This saves space (otherwise every app would contain a copy of all the run-time libraries they used, leading to massive duplication) but can lead to the sort of problems you're experiencing, where updates to the runtime can 'break' apps that previously worked.

This happens because when you call an iOS function (in SpriteKit, UIKit etc) your code branches to some code stored in the phone itself. If this code has changes (with an iOS update) and suddenly expects a CGVector instead of a CGPoint, or a 3rd parameter on a function call, the program will fail.

Some compilers have the ability to 'bind' the run-time libraries in with the executable, making the app more resilient to OS upgrades, but this can have knock-on effects, such as programs running with a run-time that is years (or even decades for some code I've dealt with) that just doesn't work anymore (Y2K provided examples of this, with older versions of IBM's COBOL run-time environment on mainframes not being Y2K compliant) and bringing the application up-to-date is a massive job, compared to having to update for just one incremental release of the run-time.

Upvotes: 2

MoDJ
MoDJ

Reputation: 4425

It is part of iOS. You can use the previous OpenGL mode in iOS 9.X by setting the PrefersOpenGL=YES flag in Info.plist, for more info see https://stackoverflow.com/a/37768928/763355

Upvotes: 1

Related Questions