Skip to content

Blocks for SHTextViewBlocks without libffi and swizzling. Getter and Setter properties.

License

Notifications You must be signed in to change notification settings

seivan/SHTextViewBlocks

Repository files navigation

Deprecated, please use RxCocoa

#SHTextViewBlocks

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

Using blocks instead of delegate callbacks for SHTextViewBlocks. The blocks are gone once the textfield is gone - Swizzle Free(™)

##Installation

pod 'SHTextViewBlocks'

##Setup

Put this either in specific files or your project prefix file

#import "UITextView+SHTextViewBlocks.h"

or

#import "SHTextViewBlocks.h"

##API

#pragma mark - Block Defs
typedef void (^SHTextViewBlock)(UITextView * textView);
typedef BOOL (^SHTextViewPredicateBlock)(UITextView * textView);

typedef BOOL (^SHTextViewRangeReplacementBlock)(UITextView * textView,
NSRange shouldChangeTextInRange,
NSString * string);




#pragma mark - Helpers

#pragma mark - Properties

#pragma mark - Setters

-(void)SH_setShouldBeginEditingBlock:(SHTextViewPredicateBlock)theBlock;

-(void)SH_setShouldEndEditingBlock:(SHTextViewPredicateBlock)theBlock;

-(void)SH_setDidBeginEditingBlock:(SHTextViewBlock)theBlock;

-(void)SH_setDidEndEditingBlock:(SHTextViewBlock)theBlock;

-(void)SH_setShouldChangeCharactersInRangeWithReplacementTextBlock:(SHTextViewRangeReplacementBlock)theBlock;

-(void)SH_setDidChangeBlock:(SHTextViewBlock)theBlock;

-(void)SH_setDidChangeSelection:(SHTextViewBlock)theBlock;



#pragma mark - Getters

-(SHTextViewPredicateBlock)SH_blockShouldBeginEditing;

-(SHTextViewPredicateBlock)SH_blockShouldEndEditing;


-(SHTextViewBlock)SH_blockDidBeginEditing;

-(SHTextViewBlock)SH_blockDidEndEditing;

-(SHTextViewRangeReplacementBlock)SH_blockShouldChangeCharactersInRangeWithReplacementText;

-(SHTextViewBlock)SH_blockDidChangeBlock;

-(SHTextViewBlock)SH_blockDidChangeSelection;

##Contact

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

email: seivan.heidari@icloud.com
twitter: @seivanheidari

License

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

About

Blocks for SHTextViewBlocks without libffi and swizzling. Getter and Setter properties.

Resources

License

Stars

Watchers

Forks

Packages