Swift Playgrounds: Replacement for captureValue(_:withIdentifier:)
Asked Answered
S

2

12

Xcode 7.3 has deprecated XCPlaygroundPage.currentPage.captureValue(_:withIdentifier:). Its predecessor, XCPCaptureValue(), was deprecated in Xcode 7.1.

I'm wondering if there is any replacement, apart from implicit capture of collections and in loops? Apart from being more flexible using the explicit approach, the ability to add captions to graphs seems to be gone with the deprecation/removal (although the symbols are found, the aforementioned deprecated methods don't do anything, or at least not what you'd expect).

Sanjuanitasank answered 30/3, 2016 at 10:16 Comment(0)
S
4

There is currently no alternative or replacement. Graphs are only displayed implicitly. I have verified this in the Swift/Xcode labs at WWDC 2016. I have filed a radar and will update this questions, should there be any progress.

Sanjuanitasank answered 15/6, 2016 at 16:2 Comment(3)
Not to my knowledge, unfortunately. My radar was closed a long time ago, with no resolution.Sanjuanitasank
i vaguely remember it wasn't even necessary anymore because of some other change they made, but I forgot what this change was.Cripps
They seem to be able to do plotting on Swift Playgrounds for iPad, does that work now on the Mac?Paynim
S
-4

Use the currentPage property:

XCPlaygroundPage.currentPage.captureValue(_, withIdentifier:)

Sheerness answered 30/3, 2016 at 10:19 Comment(1)
That is the API that has been deprecated. I was using the notation from the Xcode docs, although I can see how it's confusing.Sanjuanitasank

© 2022 - 2024 — McMap. All rights reserved.