You can create a one-liner function to print "Hello, World!" in Swift using the following code:
main.swift55 chars4 lines
This code defines a function called sayHello
, which simply prints "Hello, World!" when called. The function is then invoked with sayHello()
to produce the desired output.
gistlibby LogSnag