Skip to content

Instantly share code, notes, and snippets.

@d3signerd
Created April 8, 2016 17:21
Show Gist options
  • Save d3signerd/62d199ab478e65847322fc407fb30855 to your computer and use it in GitHub Desktop.
Save d3signerd/62d199ab478e65847322fc407fb30855 to your computer and use it in GitHub Desktop.
Logging values in Swift on the fly
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