How to cast a struct to Anyobject in Swift 2?

前端 未结 1 2083
南方客
南方客 2021-02-20 14:42

I have,

struct S {}

Along with,

func y (x: S) -> AnyObject {}

In Swift 2, is it possible to, within y(), <

1条回答
  •  萌比男神i
    2021-02-20 15:27

    A Struct cannot conform to AnyObject. It can only conform to Any

    0 讨论(0)
提交回复
热议问题