Opposite of __conversion in Swift to assign to a value of a different type

前端 未结 2 979
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 17:04

Swift provides a special method called __conversion that allows you to implicitly convert your type to another type. I would like to be able to define a method that

2条回答
  •  没有蜡笔的小新
    2021-01-21 18:02

    It turns out that __conversion is a private method and will be removed by the end of the beta so this will definitely not be possible once Swift is released.

提交回复
热议问题