2

I'm not sure if we can declare a protocol like:

protocol UIProtocol {
    var height: CGFloat {get set}
}
protocol myProtocol : UIProtocol {
    var item: AnyObject? {get set}
}

And then if I init an array of [myProtocol], this will give me: array cannot be bridged from Objective-C

Any help?

BabyShung
  • 61
  • 4

1 Answers1

0

Marking the protocol as @objc will fix it. For more details, see this discussion: Array element cannot be bridged to Objective-C

Community
  • 1
  • 1
Adrian Schönig
  • 1,786
  • 18
  • 26