Skip to content

Commit

Permalink
Fix duplicate delegate call.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentnycum committed Oct 6, 2013
1 parent 81c2cd6 commit 77b5d51
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions BNHtmlPdfKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ - (void)saveUrlAsPdf:(NSURL *)url toFile:(NSString *)file {
#pragma mark - UIWebViewDelegate

- (void)webViewDidFinishLoad:(UIWebView *)webView {

// In iOS 7 this delegate method gets called multiple times.
// Remove delegate once being called.
// Found by Laurent Denoue
// https://twitter.com/ldenoue/status/381067564886941696
webView.delegate = nil;

UIPrintFormatter *formatter = webView.viewPrintFormatter;

BNHtmlPdfKitPageRenderer *renderer = [[BNHtmlPdfKitPageRenderer alloc] init];
Expand Down

0 comments on commit 77b5d51

Please sign in to comment.