1

I am newbie for Swift and I have question about Implictly Unwrapped Optional on Swift. And sorry for unpretty format, I'm also newbie for stackoverflow.

let x: Int! = 1
print("\(x)")

Above Swift codes print "Optional(1)". I think that should print "1" since the constant "x"`s type is "Int!" rather than "Int?" to implicitly unwrap from followed codes. But it prints "Optional(1)".

I ran that code on IBM Swift Sandbox.

What's wrong with it?

홍한석
  • 439
  • 7
  • 21

0 Answers0