Skip to content

A simple and easy to use custom alertView component in Objective-C for iOS 7.

License

Notifications You must be signed in to change notification settings

tmgsca/TMSmartAlertView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#TMSmartAlertView

A simple custom alertView component that uses Xib's to allow users to highly customize the alertView layout aswell as allowing them to handle click events.

Usage

  1. Import "TMSmartAlertView.h" on your view controller
  2. Instantiate a TMSmartAlertView object as the examples below

######Simple one button alertView

TMSmartAlertView * alertView;

- (void)viewDidLoad
{
    [super viewDidLoad];
	  alertView = [[TMSmartAlertView alloc] initWithTitle:@"Title" text:@"Alert content text" cancelButtonTitle:@"Cancel" cancelButtonSelector:@selector(cancelButtonClicked) xibName:@"CustomXibName" target:self];
	  
	  [alertView show];
}

- (void) cancelButtonClicked
{
  // Handle cancel button clicked event. This one dismisses the alertView.
  [alertView dismiss];
}

######Yes or No alertView

TMSmartAlertView * alertView;

- (void) viewDidLoad
{
    [super viewDidLoad];
	  
	  alertView = [[TMSmartAlertView alloc] initWithTitle:@"Title" text:@"Alert content text" cancelButtonTitle:@"No"       cancelButtonSelector:@selector(cancelButtonClicked) yesButtonTitle:@"Yes" yesButtonSelector:@selector(yesButtonClicked) xibName:@"CustomXibName" target:self];
	  
	  [alertView show];
}

- (void) cancelButtonClicked
{
  // Handle no/cancel button clicked event. This one dismisses the alertView.
  [alertView dismiss];
}

- (void) yesButtonClicked
{
  // Handle yes button clicked event. This one dismisses the alertView.
  [alertView dismiss];
}

License

TMSmartAlertView is licensed under the MIT License. See LICENSE for details.

Copyright © 2014 Thiago Magalhães.

About

A simple and easy to use custom alertView component in Objective-C for iOS 7.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published