# How to remove/handle deprecated warnings

**URL:** <https://forums.swift.org/t/how-to-remove-handle-deprecated-warnings/56831>\
**Category:** Using Swift\
**Created:** [April 19, 2022, 8:57pm UTC](https://forums.swift.org/t/how-to-remove-handle-deprecated-warnings/56831 "2022-04-19T20:57:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishdeshmukh](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/vishdeshmukh/32/21103_2.png) [@vishdeshmukh](https://forums.swift.org/u/vishdeshmukh)\
**Post date:** [April 19, 2022, 8:57pm UTC](https://forums.swift.org/t/how-to-remove-handle-deprecated-warnings/56831/1 "2022-04-19T20:57:29Z")

</div>

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?**

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [April 19, 2022, 11:22pm UTC](https://forums.swift.org/t/how-to-remove-handle-deprecated-warnings/56831/2 "2022-04-19T23:22:34Z")

</div>

> [@vishdeshmukh](#):
>
> Is there any automated or faster way to remove/handle **at least these** deprecated warnings

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).

---

<div class="post-metadata">

**Author:** ![vishdeshmukh](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/vishdeshmukh/32/21103_2.png) [@vishdeshmukh](https://forums.swift.org/u/vishdeshmukh)\
**Post date:** [April 19, 2022, 11:26pm UTC](https://forums.swift.org/t/how-to-remove-handle-deprecated-warnings/56831/3 "2022-04-19T23:26:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![phoneyDev](https://avatars.discourse-cdn.com/v4/letter/p/49beb7/32.png) [@phoneyDev](https://forums.swift.org/u/phoneyDev)\
**Post date:** [April 20, 2022, 12:16am UTC](https://forums.swift.org/t/how-to-remove-handle-deprecated-warnings/56831/4 "2022-04-20T00:16:25Z")

</div>

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.
