Latest 3.0.0
Homepage https://github.com/Meniny/MXDialog-in-Objective-C
License MIT
Platforms ios 7.0, requires ARC
Dependencies MXBaseAlert
Frameworks Foundation, UIKit

MXDialog-in-Objective-C

MXDialog is an Android like alert view.

Installation with CocoaPods

pod 'MXDialog'

Usage

#import "MXDialog.h"
  • Builder
MXDialog *d = [MXDialog builder];
  • Show & Hide
[d show];
[d hide];
  • Title & Message
NSString *title = @"Dialog";
NSString *message = [NSString stringWithFormat:@"Some messagenLine break, Line break, Line break, Line break, Line breaknRandom Number:%zd", arc4random_uniform(200)];

[d setTitle:title]
[d setMessage:message];
  • Icon
[d setIcon:[UIImage imageNamed:@"android"]];
  • Buttons
[d setPositiveButton:@"OK" onClickListener:^(MXDialog * _Nonnull dialog) {
    NSLog(@"OK Clicked");
    [dialog hide];
}];

[d setNegativeButton:@"Cancel" onClickListener:^(MXDialog * _Nonnull dialog) {
    NSLog(@"Cancel Clicked");
    [dialog hide];
}];
  • Cunstom View
UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"android"]];
[image setContentMode:UIViewContentModeScaleAspectFit];
[d setView:image];

Latest podspec

{
    "name": "MXDialog",
    "version": "3.0.0",
    "summary": "An Android like alert view",
    "description": "The first stable version of MXDialog, an Android like alert view",
    "homepage": "https://github.com/Meniny/MXDialog-in-Objective-C",
    "license": "MIT",
    "authors": "Elias Abel",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/Meniny/MXDialog-in-Objective-C.git",
        "tag": "3.0.0"
    },
    "source_files": "MXDialog-OC/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "dependencies": {
        "MXBaseAlert": []
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This