MXDialog 3.0.0

MXDialog 3.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Nov 2016

Maintained by Meniny.



MXDialog 3.0.0

  • By
  • Elias Abel

MXDialog-in-Objective-C

MXDialog is an Android like alert view.

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 message\nLine break, Line break, Line break, Line break, Line break\nRandom 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];