Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Blocks for UIWebView request callbacks - swizzle and libffi free!

License

Notifications You must be signed in to change notification settings

seivan-archives/SHWebViewBlocks

Repository files navigation

Deprecated, please use RxCocoa

SHWebViewBlocks

CI Status Version Platform License

This pod is used by SHUIKitBlocks as part of many components covering to plug the holes missing from Foundation, UIKit, CoreLocation, GameKit, MapKit and other aspects of an iOS application's architecture.

Overview

Request blocks for UIWebView. The blocks are automatically removed once they UIWebView is gone, so it isn't necessary to clean up - Swizzle Free(™)

API

Installation

pod 'SHWebViewBlocks'

Setup

Put this either in specific files or your project prefix file

#import "UIWebView+SHWebViewBlocks.h"

or

#import "SHWebViewBlocks.h"

API

Helpers

#pragma mark -
#pragma mark Helpers
-(void)SH_loadRequestWithString:(NSString *)theString;

Properties

#pragma mark -
#pragma mark Block Def
typedef void (^SHWebViewBlock)(UIWebView * theWebView);

typedef void (^SHWebViewBlockWithError)(UIWebView * theWebView, NSError * theError);

typedef BOOL (^SHWebViewBlockWithRequest)(UIWebView * theWebView, NSURLRequest * theRequest,UIWebViewNavigationType theNavigationType);

                                            
#pragma mark -
#pragma mark Properties

#pragma mark -
#pragma mark Setters


-(void)SH_setShouldStartLoadWithRequestBlock:(SHWebViewBlockWithRequest)theBlock;

-(void)SH_setDidStartLoadBlock:(SHWebViewBlock)theBlock;

-(void)SH_setDidFinishLoadBlock:(SHWebViewBlock)theBlock;

-(void)SH_setDidFailLoadWithErrorBlock:(SHWebViewBlockWithError)theBlock;




#pragma mark -
#pragma mark Getters

@property(nonatomic,readonly) SHWebViewBlockWithRequest SH_blockShouldStartLoadingWithRequest;

@property(nonatomic,readonly) SHWebViewBlock SH_blockDidStartLoad;

@property(nonatomic,readonly) SHWebViewBlock SH_blockDidFinishLoad;

@property(nonatomic,readonly) SHWebViewBlockWithError SH_blockDidFailLoadWithError;

Contact

If you end up using SHWebViewBlocks in a project, I'd love to hear about it.

email: [email protected]
twitter: @seivanheidari

License

SHWebViewBlocks is © 2013 Seivan and may be freely distributed under the MIT license. See the LICENSE.md file.

About

Blocks for UIWebView request callbacks - swizzle and libffi free!

Resources

License

Stars

Watchers

Forks

Packages

No packages published