I have implemented Game Center within my app and if I run it on devices lower than iOS 8.1, it throws me an error saying something along the lines of that this feature isn't available on devices lower than iOS 8.1. I have a button which opens up the leaderboard, so how can I effectively achieve saying something like if (iOS < 8.1) { leaderboard.button = disabled}? Or is there a better way to just stop leaderboard from not loading up at all on devices lower than iOS 8.1?
Edit: Error that I get 'Menu' is only available on OS 8.0 and newer
. But if I write @available(iOS 8.0, *)
on top of the class, I get rid of this error. However, if I ran the app on iOS < 8.0, and hitted the leaderboard button, the app crashes. Menu
is the class in which I have Game Center implemented.