Instance Method
インスタンスメソッド
conforms(to:)
Returns a Boolean value that indicates whether the receiver conforms to a given protocol.
レシーバが指定したプロトコルに準拠するかどうかを指し示すブール値を返します。
Required.
必須。
Technology
- Objective-C Runtime
Objective-Cランタイム
Parameters
パラメータ
aProtocol
A protocol object that represents a particular protocol.
Return Value
戻り値
true
if the receiver conforms to aProtocol
, otherwise false
.
Discussion
解説
This method works identically to the conforms(to:)
class method declared in NSObject
. It’s provided as a convenience so that you don’t need to get the class object to find out whether an instance can respond to a given set of messages.
See Also
参照
Testing Object Inheritance, Behavior, and Conformance
func isKind(of: AnyClass) -> Bool
Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.
Required.
必須。
func responds(to: Selector!) -> Bool
Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message.
Required.
必須。