<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="">Hi Enrico,<div class="">Thanks for your reply. This means, however, that I can’t easily distribute my code along with this synthetic child provider in a package or a library, correct?</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 29 Jun 2016, at 19:16, Enrico Granata <<a href="mailto:egranata@apple.com" class="">egranata@apple.com</a>> wrote:</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="">Tim,</div><div class="">the Xcode variables view is controlled by a different mechanism than the playgrounds/po - there is a reference for that mechanism at <a href="http://lldb.llvm.org/varformats.html" class="">http://lldb.llvm.org/varformats.html</a></div><div class="">The gist of it is that you're going to want to make a <i class="">synthetic child provider</i> that returns no child elements for your object - that will be what the variables view picks up</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 26, 2016, at 9:41 PM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Sun, Jun 26, 2016 at 5:03 PM, Tim Vermeulen <<a href="mailto:tvermeulen@me.com" class="">tvermeulen@me.com</a>> wrote:<br class=""><blockquote type="cite" class="">I already did that, sorry for not providing any code. Take this as an<br class="">example:<br class=""><br class="">public struct Wrapper<Element> {<br class=""><br class=""> private var elements: [Element]<br class=""><br class=""> public init<S: Sequence where S.Iterator.Element == Element>(_ sequence:<br class="">S) {<br class=""> elements = [Element](sequence)<br class=""> }<br class=""><br class="">}<br class=""><br class="">extension Wrapper: Collection {<br class=""><br class=""> public var startIndex: Int { return elements.startIndex }<br class=""> public var endIndex: Int { return elements.endIndex }<br class=""><br class=""> public func index(after index: Int) -> Int {<br class=""> return index + 1<br class=""> }<br class=""><br class=""> public subscript(position: Int) -> Element {<br class=""> return elements[position]<br class=""> }<br class=""><br class="">}<br class=""><br class="">extension Wrapper: CustomReflectable {<br class=""><br class=""> public var customMirror: Mirror {<br class=""> return Mirror(self, unlabeledChildren: self, displayStyle:<br class="">.collection)<br class=""> }<br class=""><br class="">}<br class=""><br class="">If I debug an instance of this Wrapper type, then Xcode’s Variables View<br class="">will show<br class=""><br class="">▿ wrapper<br class=""> ▿ elements = x values<br class=""> [0] = 0<br class=""> [1] = …<br class=""></blockquote><br class="">I see. I'm not sure there's a way to hide anything from Xcode's variables view.<br class=""><br class="">+Enrico.<br class=""><br class="">Dmitri<br class=""><br class="">-- <br class="">main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br class="">(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>>*/<br class=""></div></div></blockquote></div><br class=""><div class="">
<div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">Thanks,</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div>
</div>
<br class=""></div></div></blockquote></div><br class=""></div></body></html>