Latest 1.0.0
License MIT
Platforms ios 6.0


Displays a small modal dialog that doesn’t cover the whole screen


The demo/ folder contains a demo project showing NBMiniModal in use.
Open and run it.


Create a subclass of NBMiniModal and define an init method for it,
passing in any needed parameters. Be sure to include a delegate.

-(id)initWithMessage:(NSString *)message

In the init method, set up all properties of the modal including its
frame size. Don’t worry about positioning it or adding it to any parent
view. In any event handlers you add to the modal, if you want to close
the modal, just call:

[self.delegate completedMiniModal:self];

In the .h file of your view controller that will display the mini modal,

#import "NBMiniModal.h"

Then implement NBMiniModalDelegate:

@interface NBViewController : UIViewController <NBMiniModalDelegate>

Then in the .m file, import:

#import "UIViewController+MiniModal.h"

When you want to display the modal, instantiate it, then call:

[self displayMiniModal:modal];

This will display the modal centered on the screen, with a mask behind
it. Then, implement the following NBMiniModalDelegate method:

-(void)completedMiniModal:(NBMiniModal *)modal
    [self dismissMiniModal];

Add any other handling code you want, to respond to what the user did in
the modal.


This class has been tested back to iOS 6.1.


The NBMiniModal is just a simple UIView. The UIViewController category
includes code to display that view centered in the view, show the mask,
and add parallax to it for iOS 7.


This code is released under the MIT License. See the LICENSE file for

Latest podspec

    "name": "NBMiniModal",
    "version": "1.0.0",
    "summary": "Displays a small modal dialog that doesn't cover the whole screen.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Josh Justice": "[email protected]"
    "platforms": {
        "ios": "6.0"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "source_files": [
    "requires_arc": false

Pin It on Pinterest

Share This