Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am rtyer on github.
* I am rtyer (https://keybase.io/rtyer) on keybase.
* I have a public key whose fingerprint is EF11 F9BF C16C 2BE9 8D31 75B1 0BFF 8545 4BA0 C8FA
To claim this, I am signing this object:
Verifying that +rctyer is my blockchain ID. https://onename.com/rctyer
[UIViewController aspect_hookSelector:@selector(viewDidAppear:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo>aspectInfo, BOOL animated){
//use aspectInfo.instance to differentiate
} error:NULL];
//Do NOT do this
//This will correctly attach
[FirstViewController aspect_hookSelector:@selector(viewDidAppear:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo>aspectInfo, BOOL animated){
//stuff
} error:NULL];
//This won’t attach and will throw a warning
[SecondViewController aspect_hookSelector:@selector(viewDidAppear:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo>aspectInfo, BOOL animated){
//stuff
[JCAAuthenticator aspect_hookSelector:@selector(clearAuthenticationData) withOptions:AspectPositionAfter usingBlock:^{
DDLogVerbose(@"User Sign Out");
[ARAnalytics event:@"signout"];
} error:NULL];
[MyBackendService aspect_hookSelector:@selector(loadRecordForId:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo>aspectInfo, NSString *objectId) {
DDLogVerbose(@“Magic occurred in instance: %@ with a parameter of objectId: %@”, aspectInfo.instance, objectId);
} error: NULL];
@implementation MyBackendService
- (MyRecord)loadRecordForId:(NSString *)objectId {
//magic happens
}
@end
public interface Callable<V> {
V call() throws Exception;
}
def init = {servletContext ->
ExpandoMetaClass.enableGlobally()
Number.metaClass {
getMetersToMiles = {-> UnitConverter.convertMetersToMiles(delegate)}
getMilesToMeters = {-> UnitConverter.convertMilesToMeters(delegate)}
}
}