<p dir="ltr">As Quinn said, this is a hard question to answer. As Dave said in wwdc 15. Will you make comparisons over your collection. There's great examples of how you can do this. Unfortunately, without a usecase. This response is philosophical.</p>
<div class="gmail_quote">On Jul 26, 2016 3:37 AM, "Quinn "The Eskimo!" via swift-users" <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 25 Jul 2016, at 15:10, 褚 晓敏 via swift-users <<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>> wrote:<br>
<br>
> So what should it be, according to API design guidelines?<br>
<br>
It’s hard to answer this question without more information about your specific context. However, I think it’s safe to say that Swift expresses a preference for value types. OTOH, reference types exist for a reason: sometimes you really do want to model shared mutable state.<br>
<br>
My approach to this is to design the data structure as a value type and see how that works out for clients. If the client code looks good, you’re set. OTOH, if the client code is painful, you need to rethink.<br>
<br>
Share and Enjoy<br>
--<br>
Quinn "The Eskimo!" <<a href="http://www.apple.com/developer/" rel="noreferrer" target="_blank">http://www.apple.com/developer/</a>><br>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware<br>
<br>
<br>
_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
</blockquote></div>