 <p>Ok, I investigated a bit more. My problem was not related to the value of DEFAULT_PORT.</p> <p>Concerning the negative value in the debugger, it looks to me like a bug in Xcode and not in Swift. I did a few tests and Swift does all operations with the correct value.</p> <p>To reproduce anyone can define <code>private let DEFAULT_PORT: UInt16 = UInt16(47300)</code> in the AppDelegate and put a Breakpoint in <code>didFinishLaunchingWithOptions</code>. You should then see -18326 as value in the debugger. </p>