<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I work on an API and like any API, we frequently deprecate methods (more than we would like). I think would be useful, when you deprecate something there is a link from the old method to the new method(s). With this facility it would be possible to match the old parameter name with the new names, assuming they match in type and name and automatically fill in much of the information so you don’t have to do as much work to adopt the new API. The user would just have to add the new parameters, if a parameter is removed, it would delete it. There would also be some basic checking done to make sure the new API matched. This would work on the vast bulk of APIs. When there are multiple choices, multiple replacements would be shown and selected in the IDE. It would use most of the current attributes available in Swift. I am thinking of syntax something like this, very rough: <div class=""><br class=""></div><div class="">#begindeprecation(message=“optional comment”, available=iOS 8.0)</div><div class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""> fetchProjects(query query : </span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">?) </span><span style="font-family: Menlo;" class="">{</span></div><div class=""><font face="Menlo" class=""> // some code</font></div><div class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">#replacement(message=“some comment”), available=iOS 9.0)</span></div><div class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Helvetica;" class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""> fetchProjects(query query : </span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">?, scope : </span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">?</span><span style="font-family: Menlo;" class="">) </span><span style="font-family: Menlo;" class="">{</span></div><div style="font-family: Helvetica;" class=""><font face="Menlo" class=""> // some code</font></div><div style="font-family: Helvetica;" class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="font-family: Helvetica;" class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">#replacement(message=“some comment 2”, available=iOS 9.0) </span></div><div style="font-family: Helvetica;" class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class=""><span style="color: rgb(187, 44, 162);" class="">func</span> fetchProjects(</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">(query query : </span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">?, scope : </span><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSPredicate) {</span></div><div style="font-family: Helvetica;" class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">}</span></div><div style="font-family: Helvetica;" class=""><span style="font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">#enddeprecation</span></div></span></div><div class=""><br class=""></div><div class="">In this example, the IDE would show the two replacements, and let you select one of them, then it would automatically fill in the “query" with the replacement, and then leave a place for you to enter the “scope” parameter. If it is just deprecated with no replacements you would just leave out the #replacement part. The comment part is optional. The comments would also appear in the documentation for the method as it currently does with the deprecation attributes. Eventually when you are done supporting the deprecation, you would remove the # and the old methods. </div><div class=""><br class=""></div><div class="">The idea is to enhance the process of deprecation, as well as simplify and speed adoption of the new APIs. The user would not have to spend as much time researching the new way to do things, they would just be presented with the new way. I imagine this would also be useful to developers on the same team. I speak specifically of methods here but this would apply to other entities that you might want to deprecate as well. I am sure there is more to consider here but thought I would start out simple and the most common case. </div><div class=""><br class=""></div><div class="">- Paul </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>