Is there a way to contract in swift ?, since there is no preprocessor, this seems difficult.
What I would like to do is something similar to the following code.
#define LOGV(V) NSLog(@"%s = %@", #V, V);
NSString *myString = @"this";
LOGV(myString);
After looking, dumpit seems that there is no way to reflect the variable name.
let myString = "this"
dump(myString, name:"myString", indent: 0 maxDepth: 0, maxItems: 1)
bigkm source
share