2

What is the difference between NSLog(), println, and print?

From my experience and understanding, they all write in the Console/Debugging area but why is there the change in Swift v1.2 and v2.0?

Michael
  • 6,561
  • 5
  • 38
  • 55

1 Answers1

2

If you use 2.0 then print will offer more functionality, but they are still the same thing. Please refer to the documentation to see the added functionality.

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/

Also don't use NSLog if you are using Swift

Asdrubal
  • 2,421
  • 4
  • 29
  • 37
  • There are valid reasons to use NSLog in Swift, like when your output shall appear on the system console in production or when thread synchrony is required. – codingFriend1 Aug 09 '16 at 11:32