pmusolino / PMAlertController

PMAlertController is a great and customizable alert that can substitute UIAlertController
MIT License
2.53k stars 187 forks source link

How to use with obj-c? #4

Closed afiq90 closed 8 years ago

pmusolino commented 8 years ago

Hi @afiq90.

I've updated PMAlertController, and now Objective-C is supported. Please update your pod.

How to use with obj-c: After the creation of a bridging header, use PMAlertController like this: `

@import PMAlertController;

PMAlertController *alert = [[PMAlertController alloc]initWithTitle:@"A Title" description:@"My Description" image:nil style:PMAlertControllerStyleAlert];

[alert addAction:[[PMAlertAction alloc]initWithTitle:@"Cancel" style:PMAlertActionStyleCancel action:^{

}]];

[alert addAction:[[PMAlertAction alloc]initWithTitle:@"OK" style:PMAlertActionStyleDefault action:^{

}]];

[self presentViewController:alert animated:true completion:nil];`
afiq90 commented 8 years ago

thank you dude.

vsanthanam commented 6 years ago

If anyone is looking for better Objective-C compatibility, I re-wrote this whole library from scratch in Objective-C, without using the XIB file. It's more "objective-c-ish", if that makes any sense, including support for a static (fat) library packaging. https://vsanthanam.github.io/VSAlertController/