Print values to the console, read from and write to text streams, and use command line arguments.
Input and Output
Topics
Text Output
func print(Any, separator: String, terminator: String)
Writes the textual representations of the given items into the standard output.
func print<Target>(Any, separator: String, terminator: String, to: inout Target)
Writes the textual representations of the given items into the given output stream.
Command Line Input
enum Command Line
Command-line arguments for the current process.
func read Line(stripping Newline: Bool) -> String?
Returns a string read from standard input through the end of the current line or until EOF is reached.
Streams
protocol Text Output Stream
A type that can be the target of text-streaming operations.
protocol Text Output Streamable
A source of text-streaming operations.
See Also
Programming Tasks
Debugging and Reflection
Fortify your code with runtime checks, and examine your values' runtime representation.
Key-Path Expressions
Use key-path expressions to access properties dynamically.
Manual Memory Management
Allocate and manage memory manually.
Type Casting and Existential Types
Perform casts between types or represent values of any type.
C Interoperability
Use imported C types or call C variadic functions.
Operator Declarations
Work with prefix, postfix, and infix operators.