LoginSignup
2
2

More than 5 years have passed since last update.

Swift4.1でUnWrap型の出力内容が変わる

Last updated at Posted at 2018-04-04

Swift4.1からUnWrap型Any!print(Any!)\(Any!)で出力した場合の結果が変わるらしい

String! だと some(VALUE) で出力され、謎のsome()が引っ付いてくる

  • Swift4.1未満
let a: String! = "test"//test
let b: String? = "test"//Optional("test")
let c: String = "test"//test
  • Swift4.1
let a: String! = "test"//some("test")
let b: String? = "test"//Optional("test")
let c: String = "test"//test

わかんないけどOptionalのsomeから来てるのか!?

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2