NSNumber
class NSNumber
class NSNumber
import Foundation
class NSValue
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
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 Escapable
protocol ExpressibleByBooleanLiteral
A type that can be initialized with the Boolean literals true
and false
.
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 : Equatable
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 : AnyObject
The NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
protocol NSSecureCoding : NSCoding
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.
protocol Sendable
required convenience init(booleanLiteral value: Bool)
Create an instance initialized to value
.
required convenience init(bytes buffer: UnsafeRawPointer, objCType: UnsafePointer<Int8>)
required convenience init?(coder aDecoder: NSCoder)
required convenience init(floatLiteral value: Double)
Create an instance initialized to value
.
required convenience init(integerLiteral value: 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 { get }
override var classForCoder: AnyClass { get }
var decimalValue: Decimal { get }
override var description: String { get }
var doubleValue: Double { get }
var floatValue: Float { get }
override var hash: Int { get }
var int16Value: Int16 { get }
var int32Value: Int32 { get }
var int64Value: Int64 { get }
var int8Value: Int8 { get }
var intValue: Int { get }
override var objCType: UnsafePointer<Int8> { get }
var stringValue: String { get }
var uint16Value: UInt16 { get }
var uint32Value: UInt32 { get }
var uint64Value: UInt64 { get }
var uint8Value: UInt8 { get }
var uintValue: UInt { get }
static func < (lhs: NSNumber, rhs: NSNumber) -> Bool
func compare(_ otherNumber: NSNumber) -> ComparisonResult
func description(withLocale locale: Locale?) -> String
override func encode(with aCoder: NSCoder)
override func isEqual(_ value: Any?) -> Bool
func isEqual(to number: NSNumber) -> Bool
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
class NSDecimalNumber
************* NSDecimalNumber: the class **********