Providing some functionality only on certain iOS versions

Hello everyone,

We would like to release an app which supports iOS 14 and higher but has certain functionality available only on iOS 15 and higher. This is because the framework we use to provides this functionality is only available from iOS 15.

To achieve this, we are considering dynamically loading the framework based on which iOS version our app runs on.

Would this be in violation with App Review Guidelines? https://developer.apple.com/app-store/review/guidelines/#software-requirements We are worried because the section 2.5.2 says: … apps may not download, install, or execute code which introduces or changes features or functionality of the app, including other apps.

Although we think that our use case of providing the functionality at least to the users on newer iOS is legitimate.

Answered by Engineer in 802547022

Hi,

You can use @available to make certain code available to certain versions of iOS. See the documentation here for more info.

Essentially you check availability like this in Objective C:

    // Use iOS 11 APIs.
} else {
    // Alternative code for earlier versions of iOS.
}

and like this in Swift:

    // Use iOS 11 APIs.
} else {
    // Alternative code for earlier versions of iOS.
}

Rico

WWDR - DTS - Software Engineer

Hi,

You can use @available to make certain code available to certain versions of iOS. See the documentation here for more info.

Essentially you check availability like this in Objective C:

    // Use iOS 11 APIs.
} else {
    // Alternative code for earlier versions of iOS.
}

and like this in Swift:

    // Use iOS 11 APIs.
} else {
    // Alternative code for earlier versions of iOS.
}

Rico

WWDR - DTS - Software Engineer

Providing some functionality only on certain iOS versions
 
 
Q