Skip to content

Commit bb511a3

Browse files
authored
Merge pull request #2946 from spevans/pr_deprecated_protocol_class
Convert protocol ... : class to protocol ... : AnyObject
2 parents a756329 + 090c965 commit bb511a3

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

Sources/Foundation/Boxing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ internal enum _MutableUnmanagedWrapper<ImmutableType : NSObject, MutableType : N
7373
case Mutable(Unmanaged<MutableType>)
7474
}
7575

76-
internal protocol _SwiftNativeFoundationType : class {
76+
internal protocol _SwiftNativeFoundationType: AnyObject {
7777
associatedtype ImmutableType : NSObject
7878
associatedtype MutableType : NSObject, NSMutableCopying
7979
var __wrapped : _MutableUnmanagedWrapper<ImmutableType, MutableType> { get }

Sources/Foundation/NSKeyedArchiver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ extension NSKeyedArchiverDelegate {
945945

946946
/// The `NSKeyedArchiverDelegate` protocol defines the optional methods implemented
947947
/// by delegates of `NSKeyedArchiver` objects.
948-
public protocol NSKeyedArchiverDelegate : class {
948+
public protocol NSKeyedArchiverDelegate: AnyObject {
949949

950950
/// Informs the delegate that `object` is about to be encoded.
951951
///

Sources/Foundation/NSKeyedUnarchiver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ open class NSKeyedUnarchiver : NSCoder {
921921
}
922922
}
923923

924-
public protocol NSKeyedUnarchiverDelegate : class {
924+
public protocol NSKeyedUnarchiverDelegate: AnyObject {
925925

926926
// Informs the delegate that the named class is not available during decoding.
927927
// The delegate may, for example, load some code to introduce the class to the

Sources/Foundation/NSObject.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
///
2121
/// The Cocoa root class, NSObject, adopts this protocol, so all objects inheriting
2222
/// from NSObject have the features described by this protocol.
23-
public protocol NSObjectProtocol : class {
23+
public protocol NSObjectProtocol: AnyObject {
2424

2525
/// Returns a Boolean value that indicates whether the instance
2626
/// and a given `object` are equal.

Sources/Foundation/Port.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extension PortDelegate {
7979
func handle(_ message: PortMessage) { }
8080
}
8181

82-
public protocol PortDelegate : class {
82+
public protocol PortDelegate: AnyObject {
8383
func handle(_ message: PortMessage)
8484
}
8585

Sources/Foundation/Stream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ extension StreamDelegate {
327327
func stream(_ aStream: Stream, handle eventCode: Stream.Event) { }
328328
}
329329

330-
public protocol StreamDelegate : class {
330+
public protocol StreamDelegate: AnyObject {
331331
func stream(_ aStream: Stream, handle eventCode: Stream.Event)
332332
}
333333

Sources/FoundationNetworking/URLSession/BodySource.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ internal func splitData(dispatchData data: DispatchData, atPosition position: In
4545
}
4646

4747
/// A (non-blocking) source for body data.
48-
internal protocol _BodySource: class {
48+
internal protocol _BodySource: AnyObject {
4949
/// Get the next chunck of data.
5050
///
5151
/// - Returns: `.data` until the source is exhausted, at which point it will

Sources/FoundationNetworking/URLSession/URLSession.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ internal extension URLSession {
640640
}
641641

642642

643-
internal protocol URLSessionProtocol: class {
643+
internal protocol URLSessionProtocol: AnyObject {
644644
func add(handle: _EasyHandle)
645645
func remove(handle: _EasyHandle)
646646
func behaviour(for: URLSessionTask) -> URLSession._TaskBehaviour

Sources/FoundationNetworking/URLSession/libcurl/EasyHandle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ internal extension _EasyHandle {
103103
delegate?.transferCompleted(withError: error)
104104
}
105105
}
106-
internal protocol _EasyHandleDelegate: class {
106+
internal protocol _EasyHandleDelegate: AnyObject {
107107
/// Handle data read from the network.
108108
/// - returns: the action to be taken: abort, proceed, or pause.
109109
func didReceive(data: Data) -> _EasyHandle._Action

Sources/FoundationXML/XMLParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ open class XMLParser : NSObject {
661661
*/
662662

663663
// The parser's delegate is informed of events through the methods in the NSXMLParserDelegateEventAdditions category.
664-
public protocol XMLParserDelegate: class {
664+
public protocol XMLParserDelegate: AnyObject {
665665

666666
// Document handling methods
667667
func parserDidStartDocument(_ parser: XMLParser)

0 commit comments

Comments
 (0)