<div dir="ltr"><div class="gmail_default" style="display:inline">I also have a question on this API </div><div class="gmail_default" style="font-family:georgia,serif;display:inline">`func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?)`. Why did it use `throws`? The other APIs, which use NSError in Objective-C, change to throws in Swift counterpart.</div><div><div class="gmail_default" style="font-family:georgia,serif;display:inline"><br></div></div><div><div class="gmail_default" style="font-family:georgia,serif;display:inline">Zhaoxin</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 8, 2016 at 10:52 AM, Shawn Erickson <span dir="ltr"><<a href="mailto:shawnce@gmail.com" target="_blank">shawnce@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">For one RealmSwift should likely consider changing their enum cases to use lowerCamelCase like Swift 3 did. Also at some point it should consider the changes to NSError / Swift.Error bridging.<div><br></div><div>-Shawn</div></div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Wed, Sep 7, 2016 at 7:18 PM Zhao Xin via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">When I use RealmSwift in my project, I got an alert " 'Error' is ambiguous for type lookup in this context".</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default"><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> UIKit</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> UserNotifications</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> WatchConnectivity</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> RealmSwift</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span><br></span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal;color:rgb(112,61,170)"><span style="color:rgb(187,44,162)">extension</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(79,129,135)">AppDelegate</span><span style="color:rgb(0,0,0)">:</span><span>WCSessionDelegate</span><span style="color:rgb(0,0,0)"> {</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span> </span><span style="color:rgb(187,44,162)">func</span><span> session(</span><span style="color:rgb(187,44,162)">_</span><span> session: </span><span style="color:rgb(112,61,170)">WCSession</span><span>, activationDidCompleteWith activationState: </span><span style="color:rgb(112,61,170)">WCSessionActivationState</span><span>, error: </span><span style="color:rgb(112,61,170)">Error</span><span>?) { </span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><br></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span>
</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span> }</span></p><div style="font-family:georgia,serif"><span style="font-family:menlo;font-size:11px"> }</span><br></div><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span><br></span></p><p style="margin:0px;line-height:normal"><font color="#000000" face="georgia, serif"><span>I think the reason is that in Swift, Error is a protocol. And in RealmSwift, there is a `</span>case Error(NSError)` in `public enum RealmCollectionChange<T>`.</font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span><br></span></font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span>I managed to eliminate the alert buy change `<span>Error</span><span>?</span>` to `</span><span>Swift</span><span>.</span><span>Error</span><span>?`. Are there any other ways to fix this?</span></font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span><br></span></font></p><p style="margin:0px;line-height:normal"><font face="georgia, serif" color="#000000"><span>Zhaoxin</span></font></p></div></div></div></div>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
</blockquote></div>
</blockquote></div><br></div>