In Swift, you’ve got a friend in the print() function.
print()
Invoke REPL by opening a terminal and running swift.
swift
To use the debugger in Xcode (the IDE for Swift), you can set breakpoints, inspect variables, and watch expressions.
Swift supports testing through its XCTest framework, which is integrated into Xcode.