Created
April 8, 2016 17:21
-
-
Save d3signerd/62d199ab478e65847322fc407fb30855 to your computer and use it in GitHub Desktop.
Logging values in Swift on the fly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class func log( message:String = "WOOT!!" ) { print( message ) } | |
class func logValues( values:AnyObject... ) { | |
guard values.count > 1 else { | |
App.log( "\( values[0] )" ) | |
return | |
} | |
var valueString:String = "\( values[0] )" | |
for index in 1..<values.count { valueString += " | \( values[ index ].dynamicType ) - \( values[ index ] )" } | |
App.log( valueString ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment