A simple way to add custom Popup. Design on Nib and use as you want. Written in Objective-C.
-
Clone/Download the master-repo.
-
Import
"RDPopup"
folder (.m/.h) into your project. -
Create an ABCIntroView property and add the ABCIntroViewDelegate.
-
Add
#import "RDPopup/RDPopup.h"
-
Create a new view/nib file. Set the class name to "CustomPopup".
-
Set the outlets to your respective views.
-
Add these lines to create a popup
RDPopup *popup = [[RDPopup alloc]initOnView:self.view];
popup.delegate = self;
-
Implement two delegate methods.
-
To show [popup showPopup];
-
To hide [popup hidePopup];
Gives you the freedom to design you own popup in nib.
Supported views on popup :
Title Label, message label, cancel button, other button, icon imageview, imageview.
RDPopup view can be customized by :
/*
Animation Duration . Default value 0.3
*/
@property (assign, nonatomic) float animationDuration;
/*
Presenting animation type
*/
@property (assign, nonatomic) FlyInAnimationDirection inAnimation;
/*
Dismissing animation type
*/
@property (assign, nonatomic) FlyOutAnimationDirection outAnimation;
/*
Background Dim enable . Default value NO
*/
@property (assign, nonatomic) BOOL blurBackground;
/*
Dismiss on Background Touch . Default value NO
*/
@property (assign, nonatomic) BOOL dismissOnBackgroundTap;
/*
Background Dim Alpha . Default value 0.3
*/
@property (assign, nonatomic) float dimBackgroundLevel;
/*
Title for Popup View. Default value @"Hi!"
*/
@property (strong, nonatomic) NSString *title;
/*
Message for Popup View. Default value @"Hello World!"
*/
@property (strong, nonatomic) NSString *message;
/*
Cancel button title for Popup View. Default value @"Cancel"
*/
@property (strong, nonatomic) NSString *cancelButtonTitle;
/*
Other button title for Popup View. Default value @"Done"
*/
@property (strong, nonatomic) NSString *otherButtonTitle;
/*
Buttons Radius . Default value 10
*/
@property (assign, nonatomic) float buttonRadius;
/*
Corner radius for Popup view. Default value 10
*/
@property (assign, nonatomic) float cornerRadius;
/*
Icon image name for Popup View. Default value @"icon"
*/
@property (strong, nonatomic) NSString *iconName;
/*
Image name for Popup View. Default value @"icon"
*/
@property (strong, nonatomic) NSString *imgName;
Please check the example included.
Suggestions/Queries/Feedbacks are welcome.
Feel free to contribute in anyway.
CHEERS!