Is it possible to extend the functionality of a Swift function? I would like appnd a single character onto every print() function in my program without having to create a br
You can overshadow the print method from the standard library:
public func print(items: Any..., separator: String = " ", terminator: String = "\n") {
let output = items.map { "*\($0)" }.joined(separator: separator)
Swift.print(output, terminator: terminator)
}
Since the original function is in the standard library, its fully qualified name is Swift.print