<div dir="ltr">Agree about &quot;1&quot; and &quot;0&quot; because it&#39;s a valid XML boolean value. But I don&#39;t know where you can find &quot;yes&quot; / &quot;no&quot; value.<div><br></div><div><a href="http://www.w3schools.com/xml/schema_dtypes_misc.asp">http://www.w3schools.com/xml/schema_dtypes_misc.asp</a><br></div>Note: Legal values for boolean are true, false, 1 (which indicates true), and 0 (which indicates false).</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 4, 2016 at 4:14 PM Leonardo Pessoa &lt;<a href="mailto:me@lmpessoa.com">me@lmpessoa.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div style="font-family:Calibri,sans-serif;font-size:11pt">I think it would be interesting if it could also recognise &quot;1&quot; and &quot;yes&quot; too as it can be useful in some cases. Perhaps have an option for this converter to be customised.<br><br>L</div></div><div dir="ltr"><hr><span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">From: </span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:swift-evolution@swift.org" target="_blank">Arsen Gasparyan via swift-evolution</a></span><br><span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Sent: </span><span style="font-family:Calibri,sans-serif;font-size:11pt">‎04/‎06/‎2016 10:10 AM</span><br><span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">To: </span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Subject: </span><span style="font-family:Calibri,sans-serif;font-size:11pt">[swift-evolution] Add conversion String -&gt; Bool</span><br><br></div></div><div><div dir="ltr">Hello,<div><br></div><div>It would be great if we had `<span style="color:rgb(51,51,51);font-size:12px;white-space:pre-wrap">init?(_ text: </span><span style="color:rgb(145,0,145);font-size:12px;white-space:pre-wrap">String</span><span style="color:rgb(51,51,51);font-size:12px;white-space:pre-wrap">)</span>` for Bool class. Because sometime when you&#39;re processing JSON/XML it can help you a lot.</div><div><br></div><div>Examples:</div><div><br></div><div><pre style="padding:0px;color:rgb(51,51,51);overflow:auto;font-size:12px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;max-height:30em">Bool(<span style="color:rgb(0,145,0)">&quot;<span>true</span>&quot;</span>) -&gt; <span style="color:rgb(0,0,145)">true</span>
Bool(<span style="color:rgb(0,145,0)">&quot;<span>false</span>&quot;</span>) -&gt; <span style="color:rgb(0,0,145)">false</span>
Bool(<span style="color:rgb(0,145,0)">&quot;TrUE&quot;</span>) -&gt; <span style="color:rgb(0,0,145)">true</span>
Bool(<span style="color:rgb(0,145,0)">&quot; <span>true</span> &quot;</span>) -&gt; nil
Bool(<span style="color:rgb(0,145,0)">&quot;1&quot;</span>) -&gt; nil
Bool(<span style="color:rgb(0,145,0)">&quot;Y&quot;</span>) -&gt; nil
Bool(<span style="color:rgb(0,145,0)">&quot;whatever&quot;</span>) -&gt; nil </pre><pre style="padding:0px;color:rgb(51,51,51);overflow:auto;font-size:12px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;max-height:30em"><br></pre><pre style="padding:0px;color:rgb(51,51,51);overflow:auto;font-size:12px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;max-height:30em"><br></pre></div>via <a href="https://bugs.swift.org/browse/SR-1282" target="_blank">https://bugs.swift.org/browse/SR-1282</a><div><br></div><div>Thanks.</div></div>
</div></blockquote></div>