UIWebView+BlocksKit.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. //
  2. // UIWebView+BlocksKit.h
  3. // BlocksKit
  4. //
  5. #import <UIKit/UIKit.h>
  6. /** Block callbacks for UIWebView.
  7. @warning UIWebView is only available on a platform with UIKit.
  8. */
  9. @interface UIWebView (BlocksKit)
  10. /** The block to be decide whether a URL will be loaded.
  11. @warning If the delegate implements webView:shouldStartLoadWithRequest:navigationType:,
  12. the return values of both the delegate method and the block will be considered.
  13. */
  14. @property (nonatomic, copy, setter = bk_setShouldStartLoadBlock:) BOOL (^bk_shouldStartLoadBlock)(UIWebView *webView, NSURLRequest *request, UIWebViewNavigationType navigationType);
  15. /** The block that is fired when the web view starts loading. */
  16. @property (nonatomic, copy, setter = bk_setDidStartLoadBlock:) void (^bk_didStartLoadBlock)(UIWebView *webView);
  17. /** The block that is fired when the web view finishes loading. */
  18. @property (nonatomic, copy, setter = bk_setDidFinishLoadBlock:) void (^bk_didFinishLoadBlock)(UIWebView *webView);
  19. /** The block that is fired when the web view stops loading due to an error. */
  20. @property (nonatomic, copy, setter = bk_setDidFinishWithErrorBlock:) void (^bk_didFinishWithErrorBlock)(UIWebView *webView, NSError *error);
  21. @end