swift protocol 'weak' cannot be applied to non-class type

前端 未结 5 2327
误落风尘
误落风尘 2020-12-05 04:00

I\'m a bit confused. What\'s the difference between protocol A : class { ... } and protocol A{ ... }, and which one we should use in swift?

<
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-05 04:33

    Or you can type like this

    @objc protocol A { ... }
    

    then you can make a weak delegate reference

提交回复
热议问题