I think the good solution is to create a delegate pattern. You can pass the class (that include UIWebView) as a delegate, then when the UIWebView finish, you just need to call back that class to notify
In your custom UIWebView:
UIMyWebView.h:
@property (nonatomic, assign) id delegate;
@property (nonatomic, assign) SEL callback;
- (id)initWithDelegate:(id)delegate callback:(SEL)callback;
UIMyWebView.m:
- (id)initWithDelegate:(id)aDelegate callback:(SEL)aCallback {
delegate = aDelegate;
callback = aCallback;
}
- webViewDidFinishLoad {
[delegate performSelector:callback];
}
YourCaller.m:
- finishLoading {
// do something when finish loading
}
- myMethod {
UIMyWebView *webView = [[UIMyWebView alloc] initWithDelegate:self callback:@selector(finishLoading)];
}