From f9d7153598b7949880ae27c5e420feaf054e5d39 Mon Sep 17 00:00:00 2001 From: Sash Zats Date: Sun, 15 Dec 2019 13:47:40 -0500 Subject: [PATCH] Conform AspectIdentifier to AspectToken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If I'm not mistaken AspectIdentifier is what being returned by `aspect_hookSelector…` method If so it's advertised that it would conform to `AspectToken` protocol It does it in informal way (by just implementing required methods) What it means is that if we check the object returned by `aspect_hookSelector…` method at runtime for the protocol conformance it will actually fail which can impact user logic relying on that --- Aspects.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Aspects.m b/Aspects.m index c907066..612fd36 100644 --- a/Aspects.m +++ b/Aspects.m @@ -45,7 +45,7 @@ - (id)initWithInstance:(__unsafe_unretained id)instance invocation:(NSInvocation @end // Tracks a single aspect. -@interface AspectIdentifier : NSObject +@interface AspectIdentifier : NSObject + (instancetype)identifierWithSelector:(SEL)selector object:(id)object options:(AspectOptions)options block:(id)block error:(NSError **)error; - (BOOL)invokeWithInfo:(id)info; @property (nonatomic, assign) SEL selector;