Latest 1.5.1
License MIT
Platforms ios 7.0, requires ARC

[![CI Status]( Koch/SmartPopup.svg?style=flat)]( Koch/SmartPopup)


To run the example project, clone the repo, and run pod install from the Example directory first.



SmartPopup is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SmartPopup"


Ricardo Koch, [email protected]


SmartPopup is available under the MIT license. See the LICENSE file for more info.


Cocoapods component for easy creating and management of UI dialogs for iOS

How to Use

Just access SmartPopup singleton from anywhere to show amazing animated popups.

SmartPopup.instance().showWithTitle("Welcome", message: "Welcome to Smart Popups!", buttons: nil)

If you want to define buttons for your model.

var btn1 = SmartPopupButton(text: "Close Me", andBlock: {
    (instance:String!) -> Void in
    //Button click callback (instance: id of the popup)

Or you can simply create them inline with the popup.

SmartPopup.instance().showWithType(SmartPopupTypeImage, image: UIImage(named: "questionIcon"), title: "Question", message: "Do you want to save?", buttons:
        SmartPopupButton(text: "Yes", andBlock: {
            (instance:String!) -> Void in 
        SmartPopupButton(text: "No", andBlock: {
            (instance:String!) -> Void in

You have five types of popups to play with: plain, with image, with image view, with activity indicator and a custom popup with xib.

Custom Popups

Custom popups can have any interface you want. They can be completly customized because they are built using the IB and a View class. The SmartPopup singleton will just manage the presentation of thoses popups for you.
To create a custom SmartPopup user interface you must first create a Xib file and design anything you want. Then create a View class and implement the following protocol:


This protocol must be implemented so the SmartPopup component understand your view as a custom popup.
This is a sample implementation you can follow:

//#Method used to instantiate the view and sent as parameter to the SmartPopup singleton
class func createFromXib() -> SmartPopupViewProtocol! {

    let array = NSBundle.mainBundle().loadNibNamed("XibNameHere", owner: self, options: nil)

    if array?.count > 0 {
        if let dialog = array![0] as? SmartPopupViewProtocol {
            return dialog
    return nil

//#Called to pass arguments to customize the behavior of the class and UI
func setArgs(args: [AnyObject]!) {

    if args != nil && args.count > 0 {
        if let arg = args[0] as? String {
            self.title = arg

//#Used when the popup is going to be shown.
func willShowWithId(identifier: String!) {
    self.popupId = identifier

//#Used when the UI components are going to be presented in the screen. This is when you should configure views, create or customize.
func config() {

Latest podspec

    "name": "SmartPopup",
    "version": "1.5.1",
    "summary": "SmartPopup allows easy creation and management of pretty UI dialogs for iOS",
    "description": "Cocoapods component for easy creation and management of animated and engaging UI dialogs for iOS. Easily create animated and modern dialogs with very little code. Customize completly the dialog UI with Xibs and reuse it throughout your app.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Ricardo Koch": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.5.1"
    "platforms": {
        "ios": "7.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"

Pin It on Pinterest

Share This