Swaps the bytes of a number.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
Discussion
Converts the little-endian formatted value in x
to the current endian format and returns the resulting value. If it is necessary to swap the bytes of x
, this function calls NSSwap
to perform the swap.