ProtocolFoundation5.9.0
NSObjectProtocol
The NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
protocol NSObjectProtocol : AnyObject
If an object conforms to this protocol, it can be considered a first-class object.
The Cocoa root class, NSObject, adopts this protocol, so all objects inheriting from NSObject have the features described by this protocol.
Requirements
var debugDescription: String
Returns a string that describes the contents of the instance for presentation in the debugger.
var description: String
Returns a string that describes the contents of the instance.
var hash: Int
Returns an integer that can be used as a table address in a hash table structure.
func isEqual(Any
?) -> Bool Returns a Boolean value that indicates whether the instance and a given
object
are equal.func isProxy(
) -> Bool Returns a Boolean value that indicates whether the instance does not descend from NSObject.
func `self`(
) -> Self Returns the instance itself.
Citizens in Foundation
Subtypes
protocol FileManagerDelegate
protocol NSCacheDelegate
protocol ProgressReporting
If your class supports reporting progress, then you can adopt the ProgressReporting protocol.