<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">As you can see, `URL` is not equal but the `path` is. I wonder why urls do not equal here?</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif"><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">let</span><span style="font-variant-ligatures:no-common-ligatures"> url = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">URL</span><span style="font-variant-ligatures:no-common-ligatures">(fileURLWithPath: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"foo/bar"</span><span style="font-variant-ligatures:no-common-ligatures">, isDirectory: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">false</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(62,30,129)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">let</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> baseURL = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">url</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">.</span><span style="font-variant-ligatures:no-common-ligatures">deletingLastPathComponent</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">()</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">let</span><span style="font-variant-ligatures:no-common-ligatures"> newURL = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">URL</span><span style="font-variant-ligatures:no-common-ligatures">(fileURLWithPath: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"bar"</span><span style="font-variant-ligatures:no-common-ligatures">, isDirectory: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">false</span><span style="font-variant-ligatures:no-common-ligatures">, relativeTo: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">baseURL</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">url</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">==</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">newURL</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span><span style="font-variant-ligatures:no-common-ligatures">// prints false</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">url</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">path</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">==</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">newURL</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">path</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span><span style="font-variant-ligatures:no-common-ligatures">// prints true</span></p></div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Zhaoxin</div><div class="gmail_default" style="font-family:georgia,serif"> </div></div>