Functions
The following functions are available globally.
-
Mechanica
Returns the type name as
String
.Declaration
Swift
public func typeName(of some: Any) -> String
-
Mechanica
‘Float’ percent operator.
Declaration
Swift
public postfix func % (value: Float) -> Float
-
Mechanica
‘Double’ percent operator.
Declaration
Swift
public postfix func % (value: Double) -> Double
-
Mechanica
Optional-string-coalescing operator.
The ??? operator takes any
optional
on its left side and adefault
string value on the right, returning a string. If the optional value is non-nil, it unwraps it and returns its string description, otherwise it returns the default value.Declaration
Swift
public func ??? <T>(optional: T?, defaultValue: @autoclosure () -> String) -> String