swiftxctestcase

What is the replacement of __PRETTY_FUNCTION__ in Swift?


In objective C, we are using like:

XCTFail("%s", __PRETTY_FUNCTION__);

what is the replacement of this when writing test cases in Swift?


Solution

  • In Swift, use "\(#function)" to replace __PRETTY_FUNCTION__