Git Product home page Git Product logo

shpopovercontrollerblocks's Introduction

SHPopoverControllerBlocks

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

Life cycle blocks for SHPopoverControllerBlocks - shouldDismiss and didDismiss. The blocks are automatically removed once they SHPopoverControllerBlocks is gone, so it isn't necessary to clean up - Swizzle Free(™)

API

Installation

pod 'SHPopoverControllerBlocks'

Setup

Put this either in specific files or your project prefix file

#import "UIPopoverController+SHPopoverControllerBlocks.h"

or

#import "SHPopoverControllerBlocks.h"

API

Properties

#pragma mark -
#pragma mark Block Def
typedef BOOL (^SHPopverControllerShouldDismissBlock)(UIPopoverController * thePopoverController);
typedef void (^SHPopverControllerDidDismissBlock)(UIPopoverController * thePopoverController);

@interface UIPopoverController (SHPopoverControllerBlocks)


#pragma mark -
#pragma mark Properties

#pragma mark -
#pragma mark Setters

-(void)SH_setShouldDismissPopoverBlock:(SHPopverControllerShouldDismissBlock)theBlock;

-(void)SH_setDidDismissPopoverBlock:(SHPopverControllerDidDismissBlock)theBlock;

#pragma mark -
#pragma mark Getters

@property(nonatomic,readonly) SHPopverControllerShouldDismissBlock SH_blockShouldDismissPopoverBlock;
@property(nonatomic,readonly) SHPopverControllerDidDismissBlock    SH_blockDidDismissPopoverBlock;
@end

Usage

  [self.popController SH_setShouldDismissPopoverBlock:^BOOL(UIPopoverController *thePopoverController) {
    testShouldDismiss = YES;
    dispatch_semaphore_signal(semaphoreShouldDismiss);
    return YES;
  }];
  
  [self.popController SH_setDidDismissPopoverBlock:^(UIPopoverController *thePopoverController) {
    testDidDismiss = YES;
    dispatch_semaphore_signal(semaphoreDidDismiss);
  }];

Contact

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

email: [email protected]
twitter: @seivanheidari

License

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

shpopovercontrollerblocks's People

Contributors

seivan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.