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: UnicodeScalar)

Construct with value v.value.

init(bitPattern: Int8)

Construct a UInt8 having the same memory representation as the Int8 bitPattern. No range or overflow checking occurs, and the resulting UInt8 may not have the same numeric value as bitPattern–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(integerLiteral: UInt8)

Create an instance initialized to value.

init(truncatingBitPattern: Int16)

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

init(truncatingBitPattern: Int64)

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

init(truncatingBitPattern: Int32)

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

init(truncatingBitPattern: UInt32)

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

init(truncatingBitPattern: UInt64)

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

init(truncatingBitPattern: UInt)

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

init(truncatingBitPattern: Int)

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

init(truncatingBitPattern: UInt16)

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

Instance Properties

var customMirror: Mirror

A mirror that reflects the UInt8 instance.

var customPlaygroundQuickLook: PlaygroundQuickLook
var description: String

A textual representation of self.

var hashValue: Int

The hash value.

Type Properties

Instance Methods

func advanced(by: Int)func distance(to: UInt8)
func toIntMax()

Explicitly convert to IntMax.

func toUIntMax()

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

Type Methods

static func addWithOverflow(UInt8, UInt8)

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

static func divideWithOverflow(UInt8, UInt8)

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

static func multiplyWithOverflow(UInt8, UInt8)

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

static func remainderWithOverflow(UInt8, UInt8)

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

static func subtractWithOverflow(UInt8, UInt8)

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