My first guess was that it would be debugDescription
or description
, but with NSURL, I'm getting something funny:
$ cd /tmp
$ xcrun swift
Welcome to Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.30). Type :help for assistance.
1> import Foundation
2> NSURL(fileURLWithPath: "X")
$R0: NSURL = "X -- ile:///private/tmp/"
It's not debugDescription
or description
:
3> NSURL(fileURLWithPath: "X").debugDescription
$R1: String = "X -- file:///private/tmp/"
4> NSURL(fileURLWithPath: "X").description
$R2: String = "X -- file:///private/tmp/"
Clearly, also, if you simply define debugDescription
and description
(like class Foo
here), it doesn't print those. (It uses them for print()
and debugPrint()
.)
What is it printing in the repl by default, though?