Latest 1.1.1
Homepage https://github.com/seivan/SHTextViewBlocks
License MIT
Platforms ios 6.0, requires ARC
Authors

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

License

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

Latest podspec

{
    "name": "SHTextViewBlocks",
    "version": "1.1.1",
    "summary": "Prefixed UITextView category replacing delegate calls with blocks. without libffi and swizzling.",
    "description": "n                    Delegate callbacks via blocks.n                    Blocks are hold with a weak reference so you don't have to cleanup when your object is gone.n  n                    * Swizzle and junk freen                    * No need to clean up after - The blocks are self maintained.n                    * Prefixed selectors.n                    * Minimum clutter on top of the public interface.n                    n",
    "homepage": "https://github.com/seivan/SHTextViewBlocks",
    "license": "MIT",
    "authors": {
        "Seivan Heidari": "[email protected]"
    },
    "source": {
        "git": "https://github.com/seivan/SHTextViewBlocks.git",
        "tag": "1.1.1"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "SHTextViewBlocks/**/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This