<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">A quick fix:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-swift" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)">guard <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">let</span> value = dict[<span class="hljs-string" style="color:rgb(221,17,68)">&quot;Key&quot;</span>].<span class="hljs-built_in" style="color:rgb(0,134,179)">map</span>({ $<span class="hljs-number" style="color:rgb(0,128,128)">0</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">as</span> <span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">NSString</span> }) {
    use(value)
}
</code></pre>
<p style="margin:0px 0px 1.2em!important">Current behavior is quite logical: main purpose of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">as?</code> is to perform casts, which are not guaranteed to succeed. But I’d say that <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">as?</code> should also support what you want.</p>
<div title="MDH:PGRpdj5BIHF1aWNrIGZpeDo8YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5gYGBzd2lmdDwv
ZGl2PjxkaXY+Z3VhcmQgbGV0IHZhbHVlID0gZGljdFsiS2V5Il0ubWFwKHsgJDAgYXMgTlNTdHJp
bmcgfSkgezwvZGl2PjxkaXY+Jm5ic3A7ICZuYnNwOyB1c2UodmFsdWUpPC9kaXY+PGRpdj59PC9k
aXY+PGRpdj5gYGA8YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5DdXJyZW50IGJlaGF2aW9y
IGlzIHF1aXRlIGxvZ2ljYWw6IG1haW4gcHVycG9zZSBvZiBgYXM/YCBpcyB0byBwZXJmb3JtIGNh
c3RzLCB3aGljaCBhcmUgbm90IGd1YXJhbnRlZWQgdG8gc3VjY2VlZC4gQnV0IEknZCBzYXkgdGhh
dCBgYXM/YCBzaG91bGQgYWxzbyBzdXBwb3J0IHdoYXQgeW91IHdhbnQuPC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div>