<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="">Hello Zaid,<div class=""><br class=""></div><div class="">I don't know what prevents you from implementing your DAOs.</div><div class=""><br class=""></div><div class="">For an example of a library that uses them extensively, see <a href="http://github.com/groue/GRDB.swift:" class="">http://github.com/groue/GRDB.swift:</a></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PointOfInterest {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> id: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3c59a7" class="">Int64</span><span style="font-variant-ligatures: no-common-ligatures" class="">?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> title: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3c59a7" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> favorite: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3c59a7" class="">Bool</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(60, 89, 167);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">var</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> coordinate: </span><span style="font-variant-ligatures: no-common-ligatures" class="">CLLocationCoordinate2D</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// (snip) adopt protocols that turn PointOfInterest in a "record"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0);" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Fetch from SQL</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> pois = </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PointOfInterest.fetchAll(db, </span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"SELECT * FROM pointOfInterests"</span><span style="font-variant-ligatures: no-common-ligatures" class="">) </span><span style="font-variant-ligatures: no-common-ligatures; color: #008f00" class="">// [PointOfInterest]</span></div><p style="margin: 0px; line-height: normal; color: rgb(0, 0, 0); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Fetch without SQL</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> title = Column(</span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"title"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> favorite = Column(</span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"favorite"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> poi1 = </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PointOfInterest.fetchOne(db, key: 1) </span><span style="font-variant-ligatures: no-common-ligatures; color: #008f00" class="">// PointOfInterest?</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> pois = </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PointOfInterest.fetchOne(db, keys: [1, 2, 3]) </span><span style="font-variant-ligatures: no-common-ligatures; color: #008f00" class="">// [PointOfInterest]</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> paris = </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PointOfInterest.filter(title == </span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"Paris"</span><span style="font-variant-ligatures: no-common-ligatures" class="">).fetchOne(db) </span><span style="font-variant-ligatures: no-common-ligatures; color: #008f00" class="">// PointOfInterest?</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> favoritePois = </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> PointOfInterest </span><span style="font-variant-ligatures: no-common-ligatures; color: #008f00" class="">// [PointOfInterest]</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> .filter(favorite)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> .order(title)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> .fetchAll(db)</span></div><p style="margin: 0px; line-height: normal; color: rgb(0, 0, 0); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Insert, update, delete</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> berlin = PointOfInterest(</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> id: </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">nil</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> title: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"Berlin"</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> favorite: </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">false</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> coordinate: CLLocationCoordinate2DMake(52.52437, 13.41053))</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> berlin.insert(db)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> berlin.id </span><span style="font-variant-ligatures: no-common-ligatures; color: #008f00" class="">// some value</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> berlin.favorite = </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">true</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> berlin.update(db)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #8135a0" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> berlin.delete(db)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div></div><div>GRDB "records" work pretty well with structs, but also class hierarchies, without any caveat.</div><div><br class=""></div><div>Can you explain a little more your issue ?</div><div><br class=""></div><div>Gwendal Roué</div><div><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class="">Le 2 juin 2017 à 11:18, Zaid Daghestani via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Greetings Swift Community,</div><div class=""><br class=""></div><div class="">Today I’m throwing out a pitch on freeing the shackles on Self. Self is a potentially significant tool that I am itching to implement in my patterns to make my code more concise, clear and intuitive.</div><div class=""><br class=""></div><div class="">Self, by far, is cherished by Data Models and ORM's, and particularly <a href="https://en.wikipedia.org/wiki/DAO" class="">DAO</a> s (<i class="">Ref. 1</i> for examples). There are a significant amount of patterns in which a base class’s methods are Self relevant and not generic relevant. Self being non-referrable in non-nominal types denies significant feature and pattern delivery such as DAO. And to deny implementation of a pattern as significant as DAO’s seems like a shot in the foot. Adding Self to non-nominal types brings Collections and Async to our class/protocol methods. A single query method returning a sync or likely async collection on my DataModel class will be used in about 80% of my app screens and 80% of my eerver API’s, almost all of the time. Hell this even applies to struct patterns as well.</div><div class=""><br class=""></div><div class="">Now, DAO’s can actually already currently be achieved via generics, see <i class="">Ref. 2</i>. This actually still a pretty good implementation, but Self is a significantly more true implementation of these patterns. Issues with the current generic pattern of Self relevancy in Swift is:</div><div class="">1- Generic methods in the base class are a <i class="">workaround</i> to the lack of Self. The base class is not a class that implements generic patterns. It a base class that implements Self patterns. Self is more concise and intuitive in implementing a DAO or any other Self relevant base class.</div><div class="">2- <i class="">Self relevant</i> patterns are distinct and not the same as <i class="">Generic</i> patterns. </div><div class="">3- In usage of a DAO, the generic pattern requires that the Left Hand Side be typed to collapse the generic. In the case of Self relevance, the particular class name is enough. Swift, being an inference language, would be truer with the Self system, and not the repetitive type declaration style of ObjC/Java that generics provide.</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> friends = User.</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">where</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">"id IN %@"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #587ea8" class="">friendIds</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) </span><span style="font-variant-ligatures: no-common-ligatures" class="">// truer to Swift type inference</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// vs.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> friends:[</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">User</span><span style="font-variant-ligatures: no-common-ligatures;" class="">] = User.</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">where</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">"id IN %@"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, friendIds) </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Java/Objective-C style repetitive type declarations</span></div></div><div class=""><br class=""></div><div class="">Let’s break the chains on Self! It is extremely intuitive, and we are all going to use it</div><div class=""><br class=""></div><div class="">Peace!</div><div class=""><br class=""></div><div class="">Z</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><i class="">Ref 1: </i>DAO patterns::</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> DataModelObject {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">/* One of the most significant use cases</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> * Retrieving a queried on collection asynchronusly</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> */</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> `where`(</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> predicate:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> args:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">CVarArg</span><span style="font-variant-ligatures: no-common-ligatures" class="">...) -> </span><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><[</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">]></span> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// querie</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(54, 86, 138);" class="">return</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(value: [[])</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// some more examples</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> // optional async get</span><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(54, 86, 138);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(54, 86, 138);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> get(id:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures;" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">?> {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(54, 86, 138);" class="">return</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 89, 0);" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(value:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(54, 86, 138);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(54, 86, 138);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(id:id))</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// sync all collection</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> all() -> [</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">] {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> []</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// asynnchronous fetch</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> allAsync() -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures" class=""><[</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">]> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures" class="">(value: [])</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// in the case of RealmDB we have returns of Results<Self>, a lazy collection</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> `where`(</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> predication:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">NSPredicate</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Results</span><span style="font-variant-ligatures: no-common-ligatures" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Results<</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">self</span><span style="font-variant-ligatures: no-common-ligatures" class="">>()</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(195, 89, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> User : </span><span style="font-variant-ligatures: no-common-ligatures" class="">DataMadelObject</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">dynamic</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> id:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">""</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">dynamic</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> name:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">""</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> friendIds = [</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">2</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">3</span><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> friends = User.</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">where</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">"id IN %@"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #587ea8" class="">friendIds</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div></div><div class=""><br class=""></div><div class=""><i class="">Ref 2: </i>Currently implementable DAO</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> DataModelObject {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">/* One of the most significant use cases</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> * Retrieving a queried on collection asynchronusly</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> */</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> `where`<T: </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">DataModelObject</span><span style="font-variant-ligatures: no-common-ligatures" class="">>(</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> predicate:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> args:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">CVarArg</span><span style="font-variant-ligatures: no-common-ligatures" class="">...) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures" class=""><[</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">T</span><span style="font-variant-ligatures: no-common-ligatures" class="">]> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// querie</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures" class="">(value: [])</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// some more examples</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""> <span style="font-variant-ligatures: no-common-ligatures;" class="">// optional async get</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> <T: DataModelObject>get(id:String) -> Promise<T?> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Promise(value:</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">self</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">init</span><span style="font-variant-ligatures: no-common-ligatures" class="">(id:id))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span></div></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// sync all collection</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> all<T: </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">DataModelObject</span><span style="font-variant-ligatures: no-common-ligatures" class="">>() -> [</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">T</span><span style="font-variant-ligatures: no-common-ligatures" class="">] {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> []</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// asynnchronous fetch</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> allAsync<T: </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">DataModelObject</span><span style="font-variant-ligatures: no-common-ligatures" class="">>() -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures" class=""><[</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">T</span><span style="font-variant-ligatures: no-common-ligatures" class="">]> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Promise</span><span style="font-variant-ligatures: no-common-ligatures" class="">(value: [])</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 135, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">// in the case of RealmDB we have returns of Results<Self>, a lazy collection</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> `where`<T: </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">DataModelObject</span><span style="font-variant-ligatures: no-common-ligatures" class="">>(</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> predication:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">NSPredicate</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">Results</span><span style="font-variant-ligatures: no-common-ligatures" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">T</span><span style="font-variant-ligatures: no-common-ligatures" class="">> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Results<</span><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="color: rgb(195, 89, 0);" class="">T</span>>()</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(195, 89, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> User : </span><span style="font-variant-ligatures: no-common-ligatures" class="">DataMadelObject</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">dynamic</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> id:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">""</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">dynamic</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> name:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">""</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> friendIds = [</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">2</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">3</span><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> friends:[</span><span style="font-variant-ligatures: no-common-ligatures; color: #c35900" class="">User</span><span style="font-variant-ligatures: no-common-ligatures" class="">] = User.</span><span style="font-variant-ligatures: no-common-ligatures; color: #36568a" class="">where</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #e82300" class="">"id IN %@"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, friendIds)</span></div></div><div class=""><br class=""></div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>