Open ClassFoundation5.9.0
NSNumber
class NSNumber
Superclasses
Citizens in Foundation
Conformances
protocol Comparable
A type that can be compared using the relational operators
<
,<=
,>=
, and>
.protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByBooleanLiteral
A type that can be initialized with the Boolean literals
true
andfalse
.protocol ExpressibleByFloatLiteral
A type that can be initialized with a floating-point literal.
protocol ExpressibleByIntegerLiteral
A type that can be initialized with an integer literal.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol NSCoding
The
NSCoding
protocol declares the two methods that a class must implement so that instances of that class can be encoded and decoded. This capability provides the basis for archiving (where objects and other structures are stored on disk) and distribution (where objects are copied to different address spaces).protocol NSCopying
The
NSCopying
protocol declares a method for providing functional copies of an object. The exact meaning of “copy” can vary from class to class, but a copy must be a functionally independent object with values identical to the original at the time the copy was made.protocol NSObjectProtocol
The
NSObjectProtocol
groups methods that are fundamental to all Foundation objects.protocol NSSecureCoding
Conforming to the
NSSecureCoding
protocol indicates that an object handles encoding and decoding instances of itself in a manner that is robust against object substitution attacks.
Members
convenience init(booleanLiteral: Bool
) Create an instance initialized to
value
.convenience init(bytes: UnsafeRawPointer, objCType: UnsafePointer<Int8>
) convenience init?(coder: NSCoder
) convenience init(floatLiteral: Double
) Create an instance initialized to
value
.convenience init(integerLiteral: Int
) Create an instance initialized to
value
.convenience init(value: Bool
) convenience init(value: Double
) convenience init(value: Float
) convenience init(value: Int
) convenience init(value: UInt
) convenience init(value: Int8
) convenience init(value: Int16
) convenience init(value: Int32
) convenience init(value: Int64
) convenience init(value: UInt8
) convenience init(value: UInt16
) convenience init(value: UInt32
) convenience init(value: UInt64
) var boolValue: Bool
var classForCoder: AnyClass
var decimalValue: Decimal
var description: String
var doubleValue: Double
var floatValue: Float
var hash: Int
var int16Value: Int16
var int32Value: Int32
var int64Value: Int64
var int8Value: Int8
var intValue: Int
var objCType: UnsafePointer<Int8>
var stringValue: String
var uint16Value: UInt16
var uint32Value: UInt32
var uint64Value: UInt64
var uint8Value: UInt8
var uintValue: UInt
static func < (NSNumber, NSNumber
) -> Bool func compare(NSNumber
) -> ComparisonResult func description(withLocale: Locale?
) -> String func encode(with: NSCoder
) func isEqual(Any
?) -> Bool func isEqual(to: NSNumber
) -> Bool
Features
static func ... (Self
) -> PartialRangeFrom<Self> Returns a partial range extending upward from a lower bound.
static func ... (Self
) -> PartialRangeThrough<Self> Returns a partial range up to, and including, its upper bound.
static func ... (Self, Self
) -> ClosedRange<Self> Returns a closed range that contains both of its bounds.
static func ..< (Self
) -> PartialRangeUpTo<Self> Returns a partial range up to, but not including, its upper bound.
static func ..< (Self, Self
) -> Range<Self> Returns a half-open range that contains its lower bound but not its upper bound.
Subclasses
class NSDecimalNumber
************* NSDecimalNumber: the class **********