SHTextViewBlocks 1.1.1

SHTextViewBlocks 1.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Seivan Heidari.



  • By
  • Seivan Heidari

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: [email protected]
twitter: @seivanheidari

License

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