Structure

UInt8

An 8-bit unsigned integer value type.

Symbols

Initializers

init()

Create an instance initialized to zero.

init(CGFloat)init(Int)init(Int64)init(UInt)
init(Float)

Creates a new instance by rounding the given floating-point value toward zero.

init(Int16)init(Int8)
init(Double)

Creates a new instance by rounding the given floating-point value toward zero.

init(Float80)

Creates a new instance by rounding the given floating-point value toward zero.

init(Int32)init(UInt8)init(UInt16)init(UInt64)init(UInt32)init(NSNumber)
init?(String, radix:​ Int)

Construct from an ASCII representation in the given radix.

init(ascii:​ Unicode​Scalar)

Construct with value v.value.

init(bit​Pattern:​ Int8)

Construct a UInt8 having the same memory representation as the Int8 bit​Pattern. No range or overflow checking occurs, and the resulting UInt8 may not have the same numeric value as bit​Pattern–it is only guaranteed to use the same pattern of bits.

init?(exactly:​ UInt64)init?(exactly:​ Int8)init?(exactly:​ Int16)init?(exactly:​ Int)init?(exactly:​ UInt8)init?(exactly:​ Int64)init?(exactly:​ UInt)init?(exactly:​ Int32)init?(exactly:​ UInt16)init?(exactly:​ UInt32)
init?(exactly:​ Float)

Creates a UInt8 whose value is value if no rounding is necessary, nil otherwise.

init?(exactly:​ Double)

Creates a UInt8 whose value is value if no rounding is necessary, nil otherwise.

init?(exactly:​ Float80)

Creates a UInt8 whose value is value if no rounding is necessary, nil otherwise.

init(integer​Literal:​ UInt8)

Create an instance initialized to value.

init(truncating​Bit​Pattern:​ Int16)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ Int64)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ Int32)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ UInt32)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ UInt64)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ UInt)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ Int)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

init(truncating​Bit​Pattern:​ UInt16)

Construct a UInt8 having the same bitwise representation as the least significant bits of the provided bit pattern.

Instance Properties

Instance Methods

func advanced(by:​ Int)func distance(to:​ UInt8)
func to​Int​Max()

Explicitly convert to Int​Max.

func to​UInt​Max()

Represent this number using Swift’s widest native unsigned integer type.

Type Methods

static func add​With​Overflow(UInt8, UInt8)

Add lhs and rhs, returning a result and a Bool that is true iff the operation caused an arithmetic overflow.

static func divide​With​Overflow(UInt8, UInt8)

Divide lhs and rhs, returning a result and a Bool that is true iff the operation caused an arithmetic overflow.

static func multiply​With​Overflow(UInt8, UInt8)

Multiply lhs and rhs, returning a result and a Bool that is true iff the operation caused an arithmetic overflow.

static func remainder​With​Overflow(UInt8, UInt8)

Divide lhs and rhs, returning the remainder and a Bool that is true iff the operation caused an arithmetic overflow.

static func subtract​With​Overflow(UInt8, UInt8)

Subtract lhs and rhs, returning a result and a Bool that is true iff the operation caused an arithmetic overflow.