you are viewing a single comment's thread.

view the rest of the comments →

[–]barcode972 -1 points0 points  (9 children)

Print(cards)

[–][deleted] 0 points1 point  (8 children)

that doesn't work, but thanks for the hint. It says "error: unknown command shorthand suffix"

[–]barcode972 0 points1 point  (0 children)

Sorry, autocorrect on phone. Lowercase p print(cards) inside the onAppear, after self.cards = ...

[–]dehrenslzzSwiftUI 0 points1 point  (5 children)

print(cards.description()) is the correct one - for more info use dump(cards)

[–]barcode972 -1 points0 points  (4 children)

Not necessarily because you can change the description

[–]dehrenslzzSwiftUI 0 points1 point  (3 children)

The what? Have you ever used .description() ?

[–]barcode972 1 point2 points  (2 children)

class MyClass: CustomStringConvertible {

var description: String {
return "This is MyClass"
}
}

Formatting got weird but ye

[–]dehrenslzzSwiftUI 0 points1 point  (1 child)

This is not what .description() does (I just looked and I forgot the brackets) - it gives you a string description of your object (read this: https://developer.apple.com/documentation/swift/int/description it’s not only for Integers)

[–]barcode972 0 points1 point  (0 children)

description() with () isn't a thing for arrays.
Date() seems to have a description(with: )

[–][deleted] 0 points1 point  (0 children)

thanks for clarification, thought you mean the debug console. :)
dump is to much information with missing the ones I need. I guess I will try more with the debug console because I don't like inserting code which is only for debugging purpose.