I have a method:
@implementation SomeClass
- (void)thisMethod:(ObjectA *)objA {
[APIClient connectToAPIWithCompletionHandler:^(id result){
if (result) [objA methodOne];
else [objA methodTwo];
}];
}
Is there a way to verify methodOne
or methodTwo
will be called when thisMethod:
is called? Basically I just want to stub that connectToAPIWithCompletionHandler:
method. Right now I can do this by swizzling connectToAPIWithCompletionHandler:
method. But I want to know if there's better way.
I found similar question here, but it's using instance method while in my case is class method.