View
extension View
-
A public global function that formats and prints a message to the console corresponding to data stored as JSON for a given print number and behaves as an analogue overload of the Swift
print(_:separator:terminator:)function.This function behaves exactly as the
Clarityglobal scope print overload with the same parameters other than to return an emptyViewthat allows it to be used within thebodyvariable of aViewBecause it will always be called within aViewit is still possible to call it without having to specify a defining type – in the same manner as the Swiftprint(_:separator:terminator:)function.Declaration
Swift
public func print(_ printNumber: Int, functionName: String? = nil, settings: SettingsManagerService? = nil) -> some ViewParameters
printNumberAn Int that acts as a unique number used as a key to access a specific associated message from a dictionary containing all message data.
functionNameAn optional parameter for a
#functionmacro argument. If this parameter is includedClarityformats and prints the log as a function call node for the function that containsprintNumber.settingsAn optional parameter for a dynamic
SettingsManagerServiceinstance. TheSettingsManagerServiceinstance can have its properties set programmatically to a variety of values. This enables more convenient and dynamic evaluation of a wider range of unit tests in a test target than is possible when using the JSON access mechanism. -
A public global function that formats and prints a message to the console corresponding to data stored as JSON for a given print number and behaves as an analogue overload of the Swift
print(_:separator:terminator:)function.This function behaves exactly as the
Clarityglobal scope print overload with the same parameters other than to return an emptyViewthat allows it to be used within thebodyvariable of aViewBecause it will always be called within aViewit is still possible to call it without having to specify a defining type – in the same manner as the Swiftprint(_:separator:terminator:)function.Declaration
Swift
public func print(_ printNumber: Int, values: Any? = nil, settings: SettingsManagerService? = nil) -> some ViewParameters
printNumberAn
Intthat acts as a unique number used as a key to access a specific associated message from a dictionary containing all message data.valuesAn optional parameter for the inclusion of variable values to be printed as part of the message. If this parameter is included
Clarityformats and prints the log as a value report node. The parameter can be a single value of any type, aCollectionof any type or an instance conforming to theErrorprotocol.settingsAn optional parameter for a dynamic
SettingsManagerServiceinstance. TheSettingsManagerServiceinstance can have its properties set programmatically to a variety of values. This enables more convenient and dynamic evaluation of a wider range of unit tests in a test target than is possible when using the JSON access mechanism.
View Extension Reference