Creates a new integer value from the given string.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
Parameters
description
The ASCII representation of a number.
Discussion
The string passed as description
may begin with a plus or minus sign character (+
or -
), followed by one or more numeric digits (0-9
).
If description
is in an invalid format, or if the value it denotes in base 10 is not representable, the result is nil
. For example, the following conversions result in nil
: