How to remove/handle deprecated warnings

I removed iOS 13 support so app support only iOS 14 and above. However, it came with lot of deprecated warnings (total warnings are around 3000) including iOS10, iOS12 which we never handled before.

e.g. keyWindow was deprecated in iOS 13.0: Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes

showsRouteButton was deprecated in iOS 13.0: Use AVRoutePickerView instead.

Is there any automated or faster way to remove/handle at least these deprecated warnings in Xcode using some scripts or some other way?

Do you have tons of just those two warnings mentioned above? If to tackle just those two, you can create your wrappers: "myKeyWindow" / "myShowsRouteButton", search / replace and reduce those warnings into just two.

I am not aware of any general solution to silent warnings (the way we did it with C++ or another).

No that’s just example of deprecated warning. There are different types warnings based on APIs used from older OS versions.

Removing these warnings manually sounds to be very time consuming. So I am checking if there could be any effective way to resolve those warnings.

Sometimes there are fix-its, which makes it easier. That might be if a type's name changed. Usually when I get going on fixing the deprecations there's a lot of repetition so it goes quickly.

I usually try to do these in advance. On a day where I don't have a lot to do I'll temporarily set the deployment target to a newer OS version and see what deprecations exist and fix some of them. So next week try iOS 15.

1 Like