The first and last are actually the same. Both indicate that the protocol can only be accepted by the class, i.e. The structure cannot accept the protocol. Form protocol OneDelegate : classis preferred. And @class_protocol protocol OneDelegateout of date.
The second case is a way to extend an existing protocol. Say, for example, you want your UITableViewDelegateanswer to a long press, then you can define the protocol:
protocol UITableViewDelegateWithRecognizer: UITableViewDelegate {
func longPressed()
}
UITableViewDelegateWithRecognizer UITableViewDelegate longPressed.
@objc, , Objective-C. , , @objc.
, ARC Swift Objective-C, weak. , Swift , . . , , , , - , .. .