Structure
ConsoleText
A collection of
ConsoleTextFragments. Represents stylized text that can be outputted to a Console.struct ConsoleText
Overview
let text: ConsoleText = "Hello, " + "world".consoleText(color: .green)
See output(_:newLine:) for more information.
Topics
Initializers
init(arrayLiteral: ConsoleTextFragment...)SeeExpressibleByArrayLiteral.init(fragments: [ConsoleTextFragment])Creates a newConsoleText.init(stringLiteral: String)SeeExpressibleByStringLiteral.
Instance Properties
var description: StringSeeCustomStringConvertible.var endIndex: IntSeeCollection.var fragments: [ConsoleTextFragment]One or moreConsoleTextFragments making up thisConsoleText.var startIndex: IntSeeCollection.
Instance Methods
func index(after: Int) -> IntSeeCollection.
Subscripts
subscript(Int) -> ConsoleTextFragmentSeeCollection.
Type Properties
static let newLine: ConsoleText\ncharacter with plain styling.
Default Implementations
Relationships
Conforms To
Swift.BidirectionalCollectionSwift.CollectionSwift.CopyableSwift.CustomStringConvertibleSwift.EscapableSwift.ExpressibleByArrayLiteralSwift.ExpressibleByExtendedGraphemeClusterLiteralSwift.ExpressibleByStringInterpolationSwift.ExpressibleByStringLiteralSwift.ExpressibleByUnicodeScalarLiteralSwift.RandomAccessCollectionSwift.SendableSwift.SendableMetatypeSwift.Sequence
See Also
Terminal
protocol ConsoleProtocol for powering styled Console I/O.class TerminalGeneric console that uses a mixture of Swift and C standard libraries to fulfill protocol requirements.enum ConsoleColorSupported colors for creating aConsoleStyleforConsoleText.struct ConsoleStyleRepresentation of a style for outputting to a Console in different colors with differing attributes. A few suggested default styles are provided.enum ConsoleClearSupported methods for clearing theConsole.struct ConsoleTextFragmentfunc + (ConsoleText, ConsoleText) -> ConsoleTextAppends aConsoleTextto anotherConsoleText.func += (inout ConsoleText, ConsoleText)Appends aConsoleTextto anotherConsoleTextin-place.extension StringProtocol