When I\'m declaring variables as weak in Swift, I sometimes get the error message from Xcode:
weak
\'weak\' may only be applied to class and
protocol PenguinDelegate: class { func userDidTapThePenguin() } class MyViewController: UIViewController { weak var delegate: PenguinDelegate? }
If you type class after your protocol it works as well and seems more appropriate that for NSObjectProtocol.