Lists of new classes for each iOS version

bradmbradm AUMember ✭✭✭
edited June 2018 in Xamarin.iOS

Is there a list, or is it possible to generate a list, of new classes/enums added in each iOS version.

We have a relatively large app and we had discovered recently that someone had put in some code to use UIImpactFeedbackGenerator, which I can see from the assembly browser was introduced in iOS 10. ([Introduced (PlatformName.iOS, 10, 0, PlatformArchitecture.All, null)]). We currently target iOS 9 and up, but it had me thinking.

Is there a list, or is it possible to generate a list of all the new classes added in each iOS version so we could do a search on our codebase for these changes? Is it possible to make the build throw a warning because deployment target and code used are of different versions?

Posts

  • LandLuLandLu Member, Xamarin Team Xamurai

    You can check the deprecated api or changed framework on this documentation.
    If you want to check whether a class is available on current iOS version with code, you can try the code below:

    // Check if class is available on current version
    if(ObjCRuntime.Class.GetHandle(typeof(UIStackView)) != IntPtr.Zero)
    {
        //We can use this class here
    }
    

    For method you can use RespondsToSelector Method, this is available in Mono Touch.

  • bradmbradm AUMember ✭✭✭

    I didn't think of deprecated, I was thinking of new functions. But now I'd like both :P.
    It isn't testing it at runtime, I was more wanting a list of classes removed and added in each iOS SDK version.

    I think the best way for me to do it is parse the Xamarin.iOS source.

  • JohnHairJohnHair GBMember ✭✭✭✭✭

    @bradm I made a suggestion many years back that it would be useful to have an option to enable a build warning/error if we are targeting an iOS version lower than the version a method/class was introduced. It didn't gain any traction unfortunately.

Sign In or Register to comment.