I'm using Playgrounds in Xcode 7.1 (beta 3) but having trouble with the captureValue()
function:
captureValue:withIdentifier: Captures a value to be displayed with the specified identifier in the timeline.
Declaration
public func captureValue(value: T, withIdentifier identifier: String)
When I call the function, all I get is this:
How do I use captureValue? Or is this a bug in beta 3?
captureValue()
displays the value you capture in the Timeline, which is a separate view that shows up in a playground's Assistant Editor. (You can show the Assistant Editor by pressing Command-Option-Return.) What you're showing is the result of the current line, which, sincecaptureValue()
returnsVoid
, is just theXCPlaygroundPage
itself.Here's what the Timeline should look like:
However, if you want to have a nice plot in playground instead of a dump list, you'll need to assign
CaptureValue
in a loop.Xcode 7.2