Skip to content

Commit

Permalink
Merge pull request #16 from nickbit/semver-1.x
Browse files Browse the repository at this point in the history
[CHANGE] Use `-class` instead of `-className` to work-around Apple's piss-poor private API usage detector. [Nikos Bitoulas](#16)
  • Loading branch information
rentzsch authored Sep 26, 2016
2 parents 6627afc + cdc5cec commit d895bff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions JRSwizzle.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,22 @@ + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)
if (!directOriginalMethod) {
inheritedOriginalMethod = class_getInstanceMethod(self, origSel_);
if (!inheritedOriginalMethod) {
SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]);
#if TARGET_OS_IPHONE
SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self class]);
#else
SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]);
#endif
return NO;
}
}
if (!directAlternateMethod) {
inheritedAlternateMethod = class_getInstanceMethod(self, altSel_);
if (!inheritedAlternateMethod) {
SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]);
#if TARGET_OS_IPHONE
SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self class]);
#else
SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]);
#endif
return NO;
}
}
Expand Down
2 changes: 1 addition & 1 deletion JRSwizzle.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'JRSwizzle'
s.version = '1.0'
s.version = '1.0.1'
s.license = 'MIT'
s.summary = 'one-stop-shop for all your method swizzling needs'
s.homepage = 'https://github.com/rentzsch/jrswizzle'
Expand Down

0 comments on commit d895bff

Please sign in to comment.