Twitter | Search | |
s ʜ  ᴘ s
ProTip: Why debug with `print` when you can `dump`? `dump` uses Mirror for introspection.
Reply Retweet Like More
s ʜ  ᴘ s 12 Oct 16
Replying to @chriseidhof
I learned this one from you on Swift Talks. Wanted to share it :)
Reply Retweet Like
Chris 12 Oct 16
Replying to @shaps
haha, I forgot about it myself... 😬
Reply Retweet Like
Jason Larsen 11 Oct 16
Replying to @shaps
what color scheme is this, if you don't mind?
Reply Retweet Like
s ʜ  ᴘ s 11 Oct 16
Replying to @Jarsen
Custom — was originally based on one of the Base16 color themes ;)
Reply Retweet Like
s ʜ  ᴘ s 11 Oct 16
Replying to @Jarsen
Reply Retweet Like
Jason Larsen 11 Oct 16
Replying to @shaps
huzzah! thanks so much!
Reply Retweet Like
Էդգար/Эдгар/إدكار 12 Oct 16
Replying to @shaps
is this just for swift/obj?
Reply Retweet Like
s ʜ  ᴘ s 12 Oct 16
Replying to @EdgarArout
you get a lot better output from a Swift class or struct. However as you can see, even Obj-C objects get better output.
Reply Retweet Like
Էդգար/Эдгар/إدكار 12 Oct 16
Replying to @shaps
right, but I mean can this be done for C, C++ or any other custom objects, is there an lldb protocol?
Reply Retweet Like
s ʜ  ᴘ s 12 Oct 16
Replying to @EdgarArout
ah right in my testing it's not supported with C or C++ because it's dependent on Swift Mirror. Sorry :-)
Reply Retweet Like
Joseph Duffy 11 Oct 16
Replying to @shaps
`age` = 21 😂😂😂
Reply Retweet Like
s ʜ  ᴘ s 11 Oct 16
Replying to @Joe_Duffy
ja! What of it?? Hahaha
Reply Retweet Like
Fuck Cancer 28 Oct 16
Replying to @shaps @bwebster
Poor performance, right? Mirror can be pretty slow. I love the extra info but the speed of print() has its place.
Reply Retweet Like
s ʜ  ᴘ s 28 Oct 16
Replying to @matthewlive @bwebster
use the right tool for the job :-) Always good to have more tools in the old tool chest :-)
Reply Retweet Like
Jeremy W. Sherman 14 Nov 16
Replying to @shaps
Best of both worlds is likely debugPrint. It's variadic like print, but reflects vs describes its arguments.
Reply Retweet Like
s ʜ  ᴘ s 15 Nov 16
Replying to @jeremywsherman
yeah I tend to use a combination of them all (and others) as appropriate. I just wanted to share another option :-)
Reply Retweet Like
Steffi 1 Nov 16
Replying to @shaps
is there a Obj-c counterpart for this?
Reply Retweet Like
s ʜ  ᴘ s 1 Nov 16
Replying to @mistakenlyIteps
not that I'm aware of. Although I haven't touched Obj-C in over a year now so I'm a little rusty ;-)
Reply Retweet Like
Steffi 1 Nov 16
Replying to @shaps
Oh Thanks! Was hoping there is. Right now am still working with Obj-c on apps in production. :)
Reply Retweet Like
Fabián Guerra Soto 22 Oct 16
Replying to @shaps
and you can use LLDB or a break point instead to avoid adding logs to your code.
Reply Retweet Like