If you're trying to initialize an unsigned Swift integer from something that might be negative, Swift won't let you unless you're explicit.
let x:Int8 = -1
let y = UInt8(x)
fails because "negative value is not representable"
but this works
let y = UInt8(bitPattern: x)
y will be 255
Topic:
Programming Languages
SubTopic:
Swift
Tags: