How about something like this? NSInteger majorSystemVersion = UIDevice.mainDevice.systemVersion.integerValue;
if (majorSystemValue == 8) AVSpeechUtterance.rate = <the wrong value that used to work> else AVSpeechUtterance.rate = <the right value> > On Jun 11, 2015, at 10:23 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > There’s a particular API that’s broken in iOS 8 (AVSpeechUtterance.rate), but > not broken in iOS 7, and fixed in iOS 9. Using Xcode 7, therefore, I get the > iOS 9 simulator, which means different speech behavior running in the > simulator from running on an actual device (still running 8.3). > > So I’m looking for a version check that will allow me to set the property > based on the running iOS version, something like this: > >> if (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber_iOS_8_0 && >> floor (NSFoundationVersionNumber) < NSFoundationVersionNumber_iOS_9_0) >> AVSpeechUtterance.rate = <the wrong value that used to work> >> else >> AVSpeechUtterance.rate = <the right value> > > but there’s no definition of NSFoundationVersionNumber_iOS_9_0 in the iOS 9 > SDK. In fact, there’s nothing higher than NSFoundationVersionNumber_iOS_8_1 > in the iOS 9 SDK. That means there’s no definition that lets me test against > 8.2, 8.3 or 8.4. > > I’m confused about what to do here. The iOS 8.3 SDK itself has no > NSFoundationVersionNumber_iOS_8_x definitions at all, so going back to Xcode > 6 wouldn't solve the problem, except that the simulator would be 8.x, so the > problem wouldn’t show up again until iOS 9 is released. > > I must be missing something really obvious here. > > (The app’s deployment target is currently set to 8.1, but I don’t think that > makes any difference, except that I don’t care about iOS 7, which is > unfortunately the one version I *could* check for.) _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com