-
Re: supported InterfaceOrientations iOS 8 vs. iOS 9
KMT Jun 19, 2015 5:09 PM (in response to Tweak)The typical way to bifurcate based on iOS version is via idioms.
Example is for Swift:
to detect iOS version
struct Version{ static let SYS_VERSION_FLOAT = (UIDevice.currentDevice().systemVersion as NSString).floatValue static let iOS7 = (Version.SYS_VERSION_FLOAT < 8.0 && Version.SYS_VERSION_FLOAT >= 7.0) static let iOS8 = (Version.SYS_VERSION_FLOAT >= 8.0 && Version.SYS_VERSION_FLOAT < 9.0) static let iOS9 = (Version.SYS_VERSION_FLOAT >= 9.0 && Version.SYS_VERSION_FLOAT < 10.0) }how to use
if Version.iOS8 { println("iOS8") } -
Re: supported InterfaceOrientations iOS 8 vs. iOS 9
Rincewind Jun 19, 2015 8:54 PM (in response to Tweak)I don't think there is a way in Swift for you to support both from a compilation stand point. Just like with other changes for Swift 2, Xcode 7, and iOS 9, I would recommend you make these changes on a branch in your code repository such that it won't interfere with your changes when working with Swift 1.2, Xcode 6.3 and iOS 8.3.
-
Re: supported InterfaceOrientations iOS 8 vs. iOS 9
Tweak Jun 21, 2015 2:06 AM (in response to Rincewind)i use Objective-C and don't know, how can i make the code available for iOS9 and iOS 8. the "old" code does not run under iOS 9 and the new dont rund under iOS 8... iam not professional and need a idea :-)
-
Re: supported InterfaceOrientations iOS 8 vs. iOS 9
junkpile Jun 21, 2015 10:11 AM (in response to Tweak)I think you are misunderstanding. The old code will run fine under iOS 8 or 9, and the new code will also run fine under iOS 8 or 9.
The old syntax won't *compile* when built using Xcode 7 and the iOS 9 *SDK*. Likewise the new syntax won't *compile* using Xcode 6 and the iOS 8 SDK. But a binary built using either tool will run on whatever OS it's targeted for.
If you're not planning to release until this fall, after Xcode 7 / iOS 9 goes public, then just use the new syntax and Xcode 7 and don't worry about it. If you need to release sooner, use Xcode 6 and the old syntax and don't worry about it. There's not much point trying to make code that compiles under either. You'd need some conditional compilation directives and it would get messy. Better to just use a branch, as Rincewind suggested, if you absolutely have to have code that compiles against both SDK versions.
-
-
-
Re: supported InterfaceOrientations iOS 8 vs. iOS 9
jacky.li.1981 Aug 2, 2015 6:38 PM (in response to Tweak)just use this one:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverriding-method-mismatch"
#pragma clang diagnostic ignored "-Wmismatched-return-types"
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#pragma clang diagnostic pop
-
Re: supported InterfaceOrientations iOS 8 vs. iOS 9
oscahie Aug 11, 2015 2:11 AM (in response to jacky.li.1981)I personally prefer this way:
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 - (NSUInteger)supportedInterfaceOrientations #else - (UIInterfaceOrientationMask)supportedInterfaceOrientations #endif
-
Level 1
Level 9
Apple Staff
Level 6