In my class I define a default port as follows:
private let DEFAULT_PORT: UInt16 = UInt16(47300)
(I also tried : private let DEFAULT_PORT: UInt16 = 47300
)
This should be perfectly ok as the maximum number of UInt16 is 65'535.
The app crashes in one method, though and the debugger shows that DEFAULT_PORT is equal to -18326.
How is this possible? Could it be a bug in Swift? I don't have a clue.