On the Xcode playground, control the row view in the column on the right?

I thought the protocol Printablewould do this, but it is not. Is there any other protocol? I want it to display 3 numbers, not "C._GLKVector3"

enter image description here

+4
source share
2 answers

As in the case of Swift 2, this can be done by setting the type to match CustomStringConvertible(earlier Printable). In case GLKVector3you would do:

extension GLKVector3: CustomStringConvertible {
    public var description: String {
        return "<\(x), \(y), \(z)>"
    }
}

enter image description here

+2
source

All Articles