Skip to content

n-b/PerformIfResponds

Repository files navigation

A performIfResponds proxy for NSObject. Never use -respondsToSelector again.

For example, this:

if([self.delegate respondsToSelector:@selector(fooForBar:]) {
	foo = [self.delegate fooForBar:self]:
}

becomes this:

foo = [[self.delegate performOrReturn:nil] fooForBar:self]:

See bou.io/PerformIfResponds for more details.

About

Never use respondsToSelector: anymore!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published