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?

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.