Latest 0.0.1
Homepage https://github.com/mownier/MONPromptView
License MIT
Platforms ios 7.0, requires ARC
Authors

A custom simple prompt view. It consists only title and message labels, and a single dismiss button where the text color and font of the two labels and the button can be customized.

![MONPromptView] (https://raw.github.com/mownier/MONPromptView/master/screenshot.gif)

Initialization

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *title = @"Hello, John Doe!";
    NSString *message = @"Welcome, Home.";
    NSString *dismissTitle = @"OK";
    MONPromptView *promptView = [[MONPromptView alloc] initWithTitle:title 
                                                             message:message 
                                                  dismissButtonTitle:dismissTitle];
}

Customization

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *title = @"Hello, John Doe!";
    NSString *message = @"Welcome, Home.";
    NSString *dismissTitle = @"OK";
    NSDictionary *attributes = @{ kMONPromptViewAttribDismissButtonBackgroundColor: [UIColor colorWithRed:40/255.0f green:122/255.0f blue:1.0f alpha:1.0f],
                                  kMONPromptViewAttribDismissButtonTextColor: [UIColor whiteColor],
                                  kMONPromptViewAttribDismissButtonFont: [UIFont fontWithName:@"HelveticaNeue-Light" size:14.0f],
                                  kMONPromptViewAttribMessageFont: [UIFont fontWithName:@"HelveticaNeue-Light" size:16.0f],
                                  kMONPromptViewAttribTitleFont: [UIFont fontWithName:@"HelveticaNeue-Medium" size:18.0f] };
    MONPromptView *promptView = [[MONPromptView alloc] initWithTitle:title
                                                             message:message
                                                  dismissButtonTitle:dismissTitle 
                                                          attributes:attributes];
}

Attribute Keys

// Dismiss Button Background Color
kMONPromptViewAttribDismissButtonBackgroundColor

// Dismiss Button Text Color
kMONPromptViewAttribDismissButtonTextColor

// Dismiss Button Font
kMONPromptViewAttribDismissButtonFont

// Title Text Color
kMONPromptViewAttribTitleTextColor

// Title Font
kMONPromptViewAttribTitleFont

// Messsage Text Color
kMONPromptViewAttribMessageTextColor

// Message Font
kMONPromptViewAttribMessageFont

Delegate

@interface ViewController : UIViewController<MONPromptViewDelegate>

@end

@implementation ViewController

#pragma mark -
#pragma mark - MONPromptView Delegate

- (void)promptViewWillDismiss:(MONPromptView *)promptView {
    // TODO Handle on dismiss
}

@end

Displaying Prompt View

// If there is no navigation controller
[promptView showInView:self.view];

// If there is a navigation controller
[promptView showInView:self.navigationController.view];

Latest podspec

{
    "name": "MONPromptView",
    "version": "0.0.1",
    "summary": "A custom simple prompt view.",
    "platforms": {
        "ios": "7.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/mownier/MONPromptView",
    "authors": {
        "Mounir Ybanez": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mownier/MONPromptView.git",
        "tag": "0.0.1"
    },
    "source_files": "MONPromptView/Source/Views/MONPromptView/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This