DialogBox

DialogBox

Every APP has a significant requirement of alerts, notifications, screen messages, toast/HUD and loadings so this time I have tried to make all of these things so simple using single library only.

All you need is to show some creativity to provide any style using this robust library.

There are several libraries out there who have the ability to change the themes but I found customisation options are very limited.

Lets start with few influential features that would make this library unique:

  1. Can handle all your Alerts, Notification, Screen Messages or loadings with the single library.
  2. Easy to understand and implement.
  3. Wide range of options for customization as per your requirement.

Check out how to show DialogBox in the APP:

Here is the code to show DialogBox:

That’s it, isn’t it simple? You just need to pass reference of “BoxAppearance” which is of struct type, best thing is you can save this setting at one place and use it across your project for the same customisation. When you want to change the theme all you need is to change at one place and get the reflection at all the places where have you used it.

Here is the setting for above alert:

Here are few examples of what you can achieve using this library:

 

Click here to see some inspirations created with DialogBox for all categories:

DialogBox Styles


Installation

GitHub

DialogBox is available on GitHub, you can access this library from

https://github.com/dhawaldawar/DialogBox

You can integrate DialogBox into your project manually by adding the files contained in the DialogBox/Classes folder to your project.

CocoaPods

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

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. A minimum version of 0.17 is required.

To install, simply add the following line to your Cartfile:


Settings

Let’s take a closer look into all settings to customise the UI of DialogBox.

All customisations will be saved in an object of “BoxAppearence” type Struct, here you will find all the settings as per various categories that are also defined in a nested Struct object so it would be easier for you. The categories are as below:

  1. Basic
  2. Layout
  3. Container Background
  4. Title
  5. Message
  6. Icon
  7. Button
  8. Close Button

Let’s take a detailed overview of all the categories:

Basic Settings:

These settings are defined at first level of “BoxAppearance” struct, you can access them as below:

Here are the list of settings:

SettingData TypeDefault ValueDescription
autoDismissBoolfalseTo set whether DialogBox should be auto dismissed after given wait time (autoDismissWaitTime).
autoDismissWaitTimeFloat3If (autoDismiss) is true DialogBox would be dismissed after given wait time.
animationBoxAnimationTypeBoxAnimationType.fadeAnimation for showing DialogBox
positionBoxPositionBoxPosition.centerPosition where DialogBox should be shown.
positionMarginFloat20To shift the position of DialogBox respective to its superview and assigned position. This will be applied only for two positions top and bottom.

Layout Settings:

These setting are specific to the layout of DialogBox and they are defined in nested Struct “Layout”, you can access them as below:

Here are the list of settings:

SettingData Type Default Value Description
widthFloat250Fixed width of Dialogbox.
paddingFloat20Padding (inner spacing) of DialogBox.
spacingFloat20Spacing among view elements in the DialogBox like title, message, icon etc.
borderWidthFloat0
borderColorUIColorUIColor.clear
enableShadowBooltrue
shadowColorUIColorUIColor.black
cornerRadiusFloat5.0
backgroundColorUIColorUIColor.white

Container Background Settings:

These settings are specific to the background view in which DialogBox will be shown and  they are defined in nested Struct “ContainerBackground”, you can access them as below:

Here are the list of settings:

SettingData TypeDefault ValueDescription
styleBoxBackgroundStyleBoxBackgroundStyle.darkBlur
colorUIColorUIColor.init(red: 0, green: 0, blue: 0, alpha: 0.5)Color will be applied only if container background style is set as BoxBackgroundStyle.customColor
tapToDismissBoolfalseTo set whether Dialogbox should be dismissed on tap, either on background or on the DialogBox itself

Title Settings:

These settings are specific to the Title of DialogBox and they are defined in nested Struct “Title”, you can access them as below:

Here are the list of settings:

SettingData TypeDefault ValueDescription
textAlignmentNSTextAlignmentNSTextAlignment.center
textColorUIColorUIColor.black
marginStringMargin to near view elements, value should be in format "(LEFT MARGIN)|(TOP MARGIN)|(RIGHT MARGIN)|(BOTTOM MARGIN)". Eg: 10|20|20|10

paddingStringPadding of the title block i.e. inner spacing, value should be in format "(LEFT MARGIN)|(TOP MARGIN)|(RIGHT MARGIN)|(BOTTOM MARGIN)". Eg: 10|20|20|10

backgroundColorUIColorUIColor.clear
fontUIFontUIFont.boldSystemFont(ofSize: 17)

Message Settings:

These settings are specific to the Message/Description of DialogBox and they are defined in nested Struct “Message”, you can access them as below:

Here are the list of settings that you can apply for Message:

SettingData TypeDefault ValueDescription
textAlignmentNSTextAlignmentNSTextAlignment.center
textColorUIColorUIColor.darkGray
marginStringMargin to near view elements, value should be in format "(LEFT MARGIN)|(TOP MARGIN)|(RIGHT MARGIN)|(BOTTOM MARGIN)". Eg: 10|20|20|10

It will apply the same way as it applies for Title margin
fontUIFontUIFont.systemFont(ofSize: 16.0)

Icon Settings:

These settings are specific to the Icon of DialogBox and they are defined in nested Struct “Icon”, you can access them as below:

Currently there are three types of Icon supported by DialogBox as mentioned below:

  1. Image
  2. Loading
  3. Font Awesome

You can change the icon type using setting boxAppearance.icon.type = BoxIconType.image

Here are the list of settings:

SettingData TypeDefault TypeDescription
typeBoxIconType
backgroundColorUIColorUIColor.clear
cornerRadiusFloat0.0
sizeCGSizeCGSize(width: 40, height: 40)
positionBoxIconPositionBoxIconPosition.centerBelowTitle
paddingStringPadding of the Icon block i.e. inner spacing, value should be in format "(LEFT MARGIN)|(TOP MARGIN)|(RIGHT MARGIN)|(BOTTOM MARGIN)". Eg: 10|20|20|10

This will work the same way as Title padding works.
marginStringMargin to near view elements, value should be in format "(LEFT MARGIN)|(TOP MARGIN)|(RIGHT MARGIN)|(BOTTOM MARGIN)". Eg: 10|20|20|10

This will work the same way as Title margin works.
separator
showBoolfalse
borderWidthFloat1
marginFloatMargin from both the edges of separator
colorUIColorUIColor.lightGray
image                             (These settings would be applied only if DialogBox icon type is set as BoxIconType.image)
nameString
contentModeUIViewContentModeUIViewContentMode.scaleToFill
fontAwesome          (These setting would be applied only if DialogBox icon type is set as BoxIconType.fontAwesome)
fontUIFont
fontCodeString
fontCodeColorUIColorUIColor.black
loading                          (These settings would be applied only if DialogBox icon type is set as BoxIconType.loading)
colorUIColorUIColor.gray
imageNameString

Button Settings:

These settings are applied on the Buttons of DialogBox and they are defined in nested Struct “Button”, you can access them as below:

Here are the list of settings:

SettingsData TypeDefault ValueDescription
borderWidthFloat0
borderColorUIColorUIColor.darkGray
heightFloat40
backgroundColorUIColorUIColor.init(red: 0.0, green: 165.0/255.0, blue: 218.0/255.0, alpha: 1.0)
textColorUIColorUIColor.white
titleFontUIFontUIFont.boldSystemFont (ofSize:17.0)
positionBoxButtonPositionBoxButtonPosition.bottom
containerMarginString
bottomPosition                (These settings would be applied only if position is set as BoxButtonPosition.bottom)
layoutBoxButtonBottom-
PositionLayout
BoxButtonBottom-
PositionLayout.withSpacing
The way buttons would be shown in the DialogBox
maximumNoOf-
ButtonsInSingleRow
Int2
cornerRadiusFloat5.0
horizontalSpacingFloat20This would be applied only if button bottom position layout is set as BoxButtonBottomPositionLayout.withSpacing
verticalSpacingFloat20This would be applied only if button bottom position layout is set as BoxButtonBottomPositionLayout.withSpacing
rightPositionLayout            (These settings would be applied only if position is set as BoxButtonPosition.right)
widthFloat60

You can also provide settings specific to each button that would be overwritten on global button settings. You have to pass object of “BoxButtonAppearance” Struct in the addButton method i.e. while adding a button.

SettingData Type
borderWidthFloat
borderColorUIColor
backgroundColorUIColor
textColorUIColor
titleFontUIFont

Close Button Settings:

These settings are specific to the Close Button of DialogBox and they are defined in nested Struct “CloseButton”, you can access them as below:

Here are the list of settings:

SetingData TypeDefault ValueDescription
showBoolfalse
positionBoxCloseButtonPositionBoxCloseButtonPosition. cornerOutside
titleString
sizesizeCGSize(width: 30, height: 30)
imageNameString
marginStringMargin from DialogBox view, value should be in format "(TOP MARGIN)|(RIGHT MARGIN). Eg: 10|10. This will be applied only if close button position is set as BoxCloseButtonPosition.cornerInside
var
fontUIFontUIFont.boldSystemFont(ofSize: 20.0)
textColorUIColorUIColor.black
backgroundColorUIColorUIColor.clear




10 Replies to “DialogBox”

  1. hi again Dhawal

    i love using your DialogBox in mine, and its easy to customize…
    i have a problem in customize the Screen Message Alert, i can set the button with desire space from bottom and it set automatically by upper space that have with message box!

    Simple i want to set the button in the bottom in screen message , just that!

    1. I am not sure if I understood your case, I guess you are referring padding space in the DialogBox that shifts the inner content from all four edges. If you don’t want padding then you can set it to 0 and then provide margin for all inner contents like title margin, message margin and button container margin to shift it as per your need.

  2. hi again Dhwal

    i have a motion for you and your project
    if you can add a TEXT FIELD to this project it will be more usefull !!!

    thanks for your attention.

  3. hi friend
    thanks for your good project
    i have a problem with DialogBox, it seems work just in INITIAL view controller, for example i can use it in my main view controller not other view controllers.

      1. @IBAction func test(_ sender: Any) {

        DialogBox.show(title: “Success!!”, message: “Your email has been sent.”, boxApp: BoxAppearance(), buttonTitle: “Go back!”, buttonAppearance: nil, actionBlock: {
        self.dismiss(animated: true) {}
        // Action block
        })
        print(“hi”)
        }

        i found another issue for this problem, this button won’t work in this ViewController because i came to this ViewController by- StoryBoard Identifier- in a same ViewController when i use -Segue-(i mean when we connect two ViewController bye Arrow) it worked very Glorious.

Leave a Reply

Your email address will not be published. Required fields are marked *

Alert #1

Show:

DialogBox.show(title: "Success", message: "You are now a new member.", boxApp:appearance, 
buttonTitle: "Ok", buttonAppearance: nil, actionBlock: nil)

Box Settings:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.backgroundColor = UIColor.init(red: 98.0/255.0, green: 193.0/255.0, 
blue: 104.0/255.0, alpha: 1.0)

Alert #2


Show:

DialogBox.show(title: "Success", message: "You are now a new member.", boxApp: appearance, 
buttonTitle: "Ok", buttonAppearance: nil, actionBlock: nil)

Box Settings:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.size = CGSize(width: 50, height: 50)
appearance.icon.image.name = "success"
appearance.icon.position = BoxIconPosition.centerBelowTitle

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.backgroundColor = UIColor.init(red: 103.0/255.0, green: 196.0/255.0, 
blue: 77.0/255.0, alpha: 1.0)

Alert #3

Show:

DialogBox.show(title: "Thank you!", message: "You are now a new member.", 
boxApp: appearance, buttonTitle: "Continue!", buttonAppearance: nil, 
actionBlock: nil)

Box Settings:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.size = CGSize(width: 70, height: 70)
appearance.icon.image.name = "success"
appearance.icon.margin = "0|-55|0|0"
appearance.icon.position = BoxIconPosition.topCenter
appearance.icon.backgroundColor = UIColor.white
appearance.icon.padding = "5|5|5|5"
appearance.icon.cornerRadius = 40

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.backgroundColor = UIColor.init(red: 103.0/255.0, green: 196.0/255.0, 
blue: 77.0/255.0, alpha: 1.0)

Alert #4

Show:

DialogBox.show(title: "Thank you!", message: "You are now a new member.", 
boxApp: appearance, buttonTitle: "Continue!", buttonAppearance: nil, 
actionBlock: nil)

Box Setting:

var appearance = BoxAppearance()

// Layout
appearance.layout.padding = 0
appearance.layout.spacing = 0
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.white
appearance.title.backgroundColor = UIColor.init(red: 103.0/255.0, green: 196.0/255.0, blue: 77.0/255.0, alpha: 1.0)
appearance.title.padding = "0|100|0|10"

// Message
appearance.message.margin = "20|0|20|0"
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.size = CGSize(width: 70, height: 70)
appearance.icon.image.name = "successWhite"
appearance.icon.margin = "0|-120|0|70"
appearance.icon.position = BoxIconPosition.centerBelowTitle

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.containerMargin = "20|20|20|20"
appearance.button.textColor = UIColor.darkGray
appearance.button.backgroundColor = UIColor.init(red: 210.0/255.0, green: 210.0/255.0, 
blue: 210.0/255.0, alpha: 1.0)
appearance.button.bottomPosition.cornerRadius = 20.0

Alert #5

Show:

DialogBox.show(title: "Thank you!", message: "You are a new member.", boxApp: appearance, 
buttonTitle: "Continue!", buttonAppearance: nil, actionBlock: nil)

Box Setting:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.size = CGSize(width: 50, height: 50)
appearance.icon.image.name = "success"
appearance.icon.position = BoxIconPosition.leftBesideMessage

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.backgroundColor = UIColor.init(red: 103.0/255.0, green: 196.0/255.0, 
blue: 77.0/255.0, alpha: 1.0)

Alert #6

Show:

let dialogBox = DialogBox.init()
dialogBox.addButton(title: "No", buttonAppearance: btnAppearanceNo){
     print("Pressed No")
}
dialogBox.addButton(title: "Yes", buttonAppearance: btnAppearanceYes) {
     print("Pressed Yes")
}
dialogBox.show(title: "Warning!", message: "Do you really want to proceed with it?", 
boxApp: appearance)

Box Setting

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)

Button Setting – “No”

var btnAppearanceNo = BoxButtonAppearance()
btnAppearanceNo.backgroundColor = UIColor.init(red: 210.0/255.0, green: 210.0/255.0, 
blue: 210.0/255.0, alpha: 1.0)
btnAppearanceNo.textColor = UIColor.darkGray

Button Setting – “Yes”

var btnAppearanceYes = BoxButtonAppearance()
btnAppearanceYes.backgroundColor = UIColor.init(red: 237.0/255.0, green: 86.0/255.0, 
blue: 77.0/255.0, alpha: 1.0)
btnAppearanceYes.textColor = UIColor.white

Alert #7

Show:

let dialogBox = DialogBox.init()
dialogBox.addButton(title: "No", buttonAppearance: btnAppearanceNo) {
    print("Pressed No")
}
dialogBox.addButton(title: "Yes", buttonAppearance: btnAppearanceYes) {
    print("Pressed Yes")
}
dialogBox.show(title: "Warning!", message: "Do you really want to proceed with it?", boxApp: BoxAppearanceAlert._7)

Box Settings:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray

// Message
appearance.message.textColor = UIColor.darkGray

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.bottomPosition.layout = BoxButtonBottomPositionLayout.withoutSpacing

Button Settings –  “No”:

var btnAppearanceNo = BoxButtonAppearance()
btnAppearanceNo.backgroundColor = UIColor.init(red: 210.0/255.0, green: 210.0/255.0, 
blue: 210.0/255.0, alpha: 1.0)
btnAppearanceNo.textColor = UIColor.darkGray

Button Settings – “Yes”:

var btnAppearanceYes = BoxButtonAppearance()
btnAppearanceYes.backgroundColor = UIColor.init(red: 237.0/255.0, green: 86.0/255.0, 
blue: 77.0/255.0, alpha: 1.0)
btnAppearanceYes.textColor = UIColor.white

Alert #8

Show Box:

let dialogBox = DialogBox.init()
dialogBox.addButton(title: "No", buttonAppearance: btnAppearanceNo) {
    print("Pressed No")
}
dialogBox.addButton(title: "Not sure", buttonAppearance: btnAppearanceNo) {
    print("Pressed Cancel")
}
dialogBox.addButton(title: "Yes", buttonAppearance: btnAppearanceYes) {
    print("Pressed Yes")
}
dialogBox.show(title: "Warning!", message: "Do you really want to proceed with it?", 
boxApp: appearance)

Box Setting

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0

// Title
appearance.title.textColor = UIColor.darkGray

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)

Button Setting – “No”

var btnAppearanceNo = BoxButtonAppearance()
btnAppearanceNo.backgroundColor = UIColor.init(red: 210.0/255.0, green: 210.0/255.0, 
blue: 210.0/255.0, alpha: 1.0)
btnAppearanceNo.textColor = UIColor.darkGray

Button Setting – “Yes”

var btnAppearanceYes = BoxButtonAppearance()
btnAppearanceYes.backgroundColor = UIColor.init(red: 237.0/255.0, green: 86.0/255.0, 
blue: 77.0/255.0, alpha: 1.0)
btnAppearanceYes.textColor = UIColor.white

Alert #9

Show Box:

let dialogBox = DialogBox.init()
dialogBox.addButton(title: "No", buttonAppearance: btnAppearanceNo) {
    print("Pressed No")
}
dialogBox.addButton(title: "Go to App Store", buttonAppearance: btnAppearanceAppStore) {
    print("Pressed Go to AppStore")
}
dialogBox.show(title: "Update required!", message: "We have made tremendous changes in the new 
version, would you like to update the APP now?", boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

// Layout
appearance.layout.padding = 0

appearance.layout.cornerRadius = 0.0
appearance.layout.width = 270.0

// Title
appearance.title.padding = "0|10|0|10"
appearance.title.textColor = UIColor.darkGray
appearance.title.backgroundColor = UIColor.init(red: 220.0/255.0, green: 220.0/255.0, 
blue: 220.0/255.0, alpha: 1.0)

// Message
appearance.message.margin = "20|0|20|0"
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "update"
appearance.icon.size = CGSize(width: 70, height: 70)

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.borderWidth = 1.0
appearance.button.borderColor = UIColor.lightGray
appearance.button.bottomPosition.layout = BoxButtonBottomPositionLayout.withoutSpacing
appearance.button.bottomPosition.maximumNoOfButtonsInSingleRow = 1

Button Setting – “No”

var btnAppearanceNo = BoxButtonAppearance()
btnAppearanceNo.backgroundColor = UIColor.white
btnAppearanceNo.textColor = UIColor.darkGray

Button Settings – “Go to App Store”

var btnAppearanceAppStore = BoxButtonAppearance()
btnAppearanceAppStore.backgroundColor = UIColor.init(red: 32.0/255.0, green: 128.0/255.0, 
blue: 175.0/255.0, alpha: 1.0)
btnAppearanceAppStore.textColor = UIColor.white

Alert #10

Show Box:

DialogBox.show(title: "Error!", message: "Oops, something went wrong.", 
boxApp: appearance, buttonTitle: "Try Again", buttonAppearance: nil, buttonBlock: {
    print("Pressed Try Again")
}, closeBlock: {
    print("Pressed Cancel")
})

Box Setting:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0
appearance.layout.backgroundColor = UIColor.init(red: 212.0/255.0, green: 72.0/255.0, 
blue: 59.0/255.0, alpha: 1.0)

// Title
appearance.title.padding = "0|30|0|10"
appearance.title.textColor = UIColor.white
appearance.title.font = UIFont.boldSystemFont(ofSize: 18.0)

// Message
appearance.message.margin = "20|0|20|0"
appearance.message.textColor = UIColor.white
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "error"
appearance.icon.size = CGSize(width: 70, height: 70)

// Animation
appearance.animation = BoxAnimationType.bounce

// Button
appearance.button.backgroundColor = UIColor.init(red: 163.0/255.0, green: 54.0/255.0, 
blue: 44.0/255.0, alpha: 1.0)
appearance.button.bottomPosition.cornerRadius = 20.0
appearance.button.containerMargin = "0|10|0|10"

// Close
appearance.closeButton.show = true
appearance.closeButton.font = UIFont.boldSystemFont(ofSize: 16.0)
appearance.closeButton.title = "X"
appearance.closeButton.textColor = UIColor.white
appearance.closeButton.position = BoxCloseButtonPosition.cornerInside

Alert #11

Show Box:

DialogBox.show(title: "Thank you!", message: "You are now a new member.", 
boxApp: appearance, closeBlock:{
    print("Pressed Cancel")
})

Box Settings:

var appearance = BoxAppearance()
        
// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0
        
// Title
appearance.title.textColor = UIColor.darkGray
        
// Message
appearance.message.textColor = UIColor.darkGray
        
// Animation
appearance.animation = BoxAnimationType.bounce
        
// Close
appearance.closeButton.show = true
appearance.closeButton.imageName = "cancel"
appearance.closeButton.position = BoxCloseButtonPosition.cornerOutside

Alert #12

Show Box:

let dialogBox = DialogBox.init()
dialogBox.addButton(title: "No", buttonAppearance: nil) {
    print("Pressed No")
}
dialogBox.addButton(title: "Yes", buttonAppearance: nil) {
    print("Pressed Yes")
}
dialogBox.show(title: "Warning!", message: "Do you really want to proceed with it?", 
boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()
        
// Layout
appearance.layout.padding = 0.0
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0
        
// Title
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.textColor = UIColor.darkGray
appearance.title.margin = "20|20|20|0"
       
// Message
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.textColor = UIColor.darkGray
appearance.message.margin = "20|0|20|0"
        
// Animation
appearance.animation = BoxAnimationType.bounce
        
// Button
appearance.button.bottomPosition.cornerRadius = 0
appearance.button.containerMargin = "120|0|0|10"
appearance.button.bottomPosition.horizontalSpacing = 0.0
appearance.button.backgroundColor = UIColor.white
appearance.button.textColor = UIColor.init(red: 237.0/255.0, green: 86.0/255.0, blue: 77.0/255.0, alpha: 1.0)

Alert #13:

Show Box:

DialogBox.show(title: "Success!", message: "Your email has been sent.", boxApp: appearance, 
buttonTitle: "Go back", buttonAppearance: nil) {
    print("Go back")
}

Box Settings:

var appearance = BoxAppearance()
        
// Layout
appearance.layout.backgroundColor = UIColor.init(red: 99.0/255.0, green: 157.0/255.0, blue: 72.0/255.0, alpha: 1.0)
appearance.layout.cornerRadius = 10.0
appearance.layout.width = 300.0
        
// Title
appearance.title.textColor = UIColor.white
appearance.title.font = UIFont.boldSystemFont(ofSize: 20.0)
        
// Message
appearance.message.textColor = UIColor.white
appearance.message.font = UIFont.systemFont(ofSize: 17.0)
        
// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "email"
appearance.icon.margin = "0|30|0|20"
appearance.icon.position = BoxIconPosition.topCenter
appearance.icon.size = CGSize(width: 116, height: 117)
        
// Animation
appearance.animation = BoxAnimationType.bounce
        
// Button
appearance.button.bottomPosition.cornerRadius = 20
appearance.button.backgroundColor = UIColor.init(red: 99.0/255.0, green: 157.0/255.0, blue: 72.0/255.0, alpha: 1.0)
appearance.button.textColor = UIColor.white
appearance.button.borderColor = UIColor.white
appearance.button.borderWidth = 2.0
appearance.button.containerMargin = "70|20|70|40"

Alert #14

Show Box:

DialogBox.show(title: nil, message: "Profile Saved", boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()
        
appearance.autoDismiss = true
appearance.position = BoxPosition.bottom
        
// Layout
appearance.layout.backgroundColor = UIColor.white
appearance.layout.cornerRadius = 10.0
appearance.layout.width = 170.0
        
// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)
appearance.containerBackground.tapToDismiss = true
        
// Message
appearance.message.textColor = UIColor.black
appearance.message.font = UIFont.boldSystemFont(ofSize: 18.0)
        
// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "save"
appearance.icon.position = BoxIconPosition.topCenter
appearance.icon.size = CGSize(width: 70, height: 70)
        
// Animation
appearance.animation = BoxAnimationType.bounce

Notification #1

Show Box:

DialogBox.show(title: "Thank you!", message: "You are now a new member.", 
boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()
        
appearance.position = BoxPosition.top
appearance.positionMargin = 20
appearance.autoDismiss = true
        
// Layout
appearance.layout.spacing = 10
appearance.layout.padding = 10
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0
appearance.layout.backgroundColor = UIColor.init(red: 98.0/255.0, green: 193.0/255.0, 
blue: 104.0/255.0, alpha: 1.0)
        
// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)
        
// Title
appearance.title.textColor = UIColor.white
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)
appearance.title.margin = "10|0|10|0"
        
// Message
appearance.message.textColor = UIColor.white
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)
appearance.message.margin = "10|0|10|0"
        
// Animation
appearance.animation = BoxAnimationType.slideFromTop

 

Notification #2

Show Box:

DialogBox.show(title: "Internet connection required.", message: nil, boxApp: appearance, 
superView: self.view)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 64
appearance.autoDismiss = true

// Layout
appearance.layout.spacing = 10
appearance.layout.padding = 20
appearance.layout.cornerRadius = 0.0
appearance.layout.width = Float(UIScreen.main.bounds.size.width)
appearance.layout.backgroundColor = UIColor.init(red: 225.0/255.0, green: 78.0/255.0, 
blue: 73.0/255.0, alpha: 1.0)

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.white
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.position = BoxIconPosition.leftFullHeight
appearance.icon.image.name = "warning"
appearance.icon.padding = "20|0|20|0"

// Animation
appearance.animation = BoxAnimationType.slideFromTop

Notification #3

Show Box:

DialogBox.show(title: "Internet connection required.", message: nil, 
boxApp: appearance, superView: self.view)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 64
appearance.autoDismiss = true

// Layout
appearance.layout.spacing = 10
appearance.layout.padding = 20

appearance.layout.cornerRadius = 0.0
appearance.layout.width = Float(UIScreen.main.bounds.size.width)
appearance.layout.backgroundColor = UIColor.init(red: 225.0/255.0, green: 78.0/255.0, 
blue: 73.0/255.0, alpha: 1.0)

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.white
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "warning"
appearance.icon.padding = "20|0|20|0"
appearance.icon.position = BoxIconPosition.leftFullHeight
appearance.icon.separator.show = true
appearance.icon.separator.borderWidth = 1.0
appearance.icon.separator.color = UIColor.white
appearance.icon.separator.margin = 10.0

// Animation
appearance.animation = BoxAnimationType.slideFromTop

Notification #4

Show Box:

DialogBox.show(title: "Login successful.", message: nil, boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.spacing = 10
appearance.layout.padding = 20
appearance.layout.cornerRadius = 10.0
appearance.layout.width = 300.0
appearance.layout.backgroundColor = UIColor.white
appearance.layout.borderWidth = 2.0
appearance.layout.borderColor = UIColor.init(red: 142.0/255.0, green: 176.0/255.0, 
blue: 37.0/255.0, alpha: 1.0)

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.darkGray
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.position = BoxIconPosition.leftFullHeight
appearance.icon.image.name = "successWhite"
appearance.icon.padding = "20|0|20|0"
appearance.icon.size = CGSize(width: 30, height: 30)
appearance.icon.backgroundColor = UIColor.init(red: 142.0/255.0, green: 176.0/255.0, 
blue: 37.0/255.0, alpha: 1.0)

// Animation
appearance.animation = BoxAnimationType.slideFromTop

Notification #5

Show Box:

DialogBox.show(title: "Thank you!", message: "You are a new member.", boxApp: appearance, 
buttonTitle: "Ok", buttonAppearance: nil) {
     print("Pressed Continue")
}

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 20

// Layout
appearance.layout.spacing = 5
appearance.layout.padding = 10
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 300.0
appearance.layout.backgroundColor = UIColor.white

// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.darkGray
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "success"
appearance.icon.position = BoxIconPosition.leftFullHeight
appearance.icon.padding = "10|0|10|0"

// Animation
appearance.animation = BoxAnimationType.slideFromTop

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)
appearance.button.textColor = UIColor.white
appearance.button.backgroundColor = UIColor.init(red: 98.0/255.0, green: 193.0/255.0, 
blue: 104.0/255.0, alpha: 1.0)
appearance.button.position = BoxButtonPosition.right

Notification #6

Show Box:

let dialogBox = DialogBox()
dialogBox.addButton(title: "Yes", buttonAppearance: nil) {
     print("Pressed Yes")
}
dialogBox.addButton(title: "No", buttonAppearance: nil) {
     print("Pressed No")
}
dialogBox.show(title: "Thank you!", message: "You are a new member.", boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 20

// Layout
appearance.layout.spacing = 5
appearance.layout.padding = 10
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 300.0
appearance.layout.backgroundColor = UIColor.init(red: 225.0/255.0, green: 78.0/255.0, 
blue: 73.0/255.0, alpha: 1.0)
       
// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.white
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Message
appearance.message.textColor = UIColor.white
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "warning"
appearance.icon.size = CGSize(width: 30, height: 30)
appearance.icon.position = BoxIconPosition.leftFullHeight
appearance.icon.padding = "10|0|10|0"

// Animation
appearance.animation = BoxAnimationType.slideFromTop

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)
appearance.button.textColor = UIColor.white
appearance.button.backgroundColor = UIColor.init(red: 178.0/255.0, green: 62.0/255.0, 
blue: 59.0/255.0, alpha: 1.0)
appearance.button.borderColor = UIColor.white
appearance.button.borderWidth = 1.0
appearance.button.position = BoxButtonPosition.right

Notification #7

Show Box:

DialogBox.show(title: "Thank you!", message: "You are now a new member.", 
boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 20

// Layout
appearance.layout.spacing = 10
appearance.layout.padding = 10
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0
appearance.layout.backgroundColor = UIColor.init(red: 98.0/255.0, green: 193.0/255.0, 
blue: 104.0/255.0, alpha: 1.0)

// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.white
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)
appearance.title.margin = "10|0|10|0"

// Message
appearance.message.textColor = UIColor.white
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)
appearance.message.margin = "10|0|10|0"

// Animation
appearance.animation = BoxAnimationType.slideFromTop

// Close
appearance.closeButton.show = true
appearance.closeButton.position = BoxCloseButtonPosition.cornerInside
appearance.closeButton.title = "x"
appearance.closeButton.textColor = UIColor.white

Notification #8

Show Box:

DialogBox.show(title: "Thank you!", message: "You are now a new member.", 
boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 30

// Layout
appearance.layout.spacing = 10
appearance.layout.padding = 10
appearance.layout.cornerRadius = 5.0
appearance.layout.width = 270.0
appearance.layout.backgroundColor = UIColor.white
       
// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, 
alpha: 0.7)

// Title
appearance.title.textColor = UIColor.init(red: 98.0/255.0, green: 193.0/255.0, 
blue: 104.0/255.0, alpha: 1.0)
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)
appearance.title.margin = "10|0|10|0"

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)
appearance.message.margin = "10|0|10|0"

// Animation
appearance.animation = BoxAnimationType.slideFromTop

// Close 
appearance.closeButton.show = true
appearance.closeButton.position = BoxCloseButtonPosition.cornerOutside
appearance.closeButton.imageName = "cancel"

Loading #1

Show Box:

DialogBox.show(title: nil, message: nil, boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.enableShadow = false
appearance.layout.width = 100.0
appearance.layout.backgroundColor = UIColor.clear
       
// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading

// Animation
appearance.animation = BoxAnimationType.fade

Loading #2

Show Box:

DialogBox.show(title: nil, message: nil, boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.enableShadow = false
appearance.layout.width = 100.0
appearance.layout.backgroundColor = UIColor.clear

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.loading.imageName = "loadingBlue"

// Animation
appearance.animation = BoxAnimationType.fade

Loading #3

Show Box:

DialogBox.show(title: nil, message: nil, boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 20
appearance.layout.enableShadow = false
appearance.layout.width = 80.0
appearance.layout.backgroundColor = UIColor.white

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.loading.imageName = "loadingBlue"

// Animation
appearance.animation = BoxAnimationType.fade

Loading #4

Show Box:

DialogBox.show(title: nil, message: "Please wait", boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.spacing = 10
appearance.layout.enableShadow = false
appearance.layout.width = 150.0
appearance.layout.backgroundColor = UIColor.white

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.position = BoxIconPosition.topCenter

appearance.icon.loading.imageName = "loadingPurple"

// Animation
appearance.animation = BoxAnimationType.fade

Loading #5

Show Box:

DialogBox.show(title: "Please wait", message: nil, boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.spacing = 10
appearance.layout.enableShadow = false
appearance.layout.width = 150.0
appearance.layout.backgroundColor = UIColor.white

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Title
appearance.title.font = UIFont.systemFont(ofSize: 16.0)
appearance.title.textColor = UIColor.darkGray

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.position = BoxIconPosition.centerBelowTitle
appearance.icon.loading.imageName = "loadingPurple"

// Animation
appearance.animation = BoxAnimationType.fade

Loading #6

Show Box:

DialogBox.show(title: nil, message: "Please wait", boxApp: BoxAppearanceLoading._6)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.spacing = 0
appearance.layout.enableShadow = false
appearance.layout.width = 150.0
appearance.layout.backgroundColor = UIColor.white

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.position = BoxIconPosition.leftBesideMessage

appearance.icon.loading.imageName = "loadingPurple"
appearance.icon.size = CGSize(width: 20, height: 20)

// Animation
appearance.animation = BoxAnimationType.fade

Loading #7

Show Box:

DialogBox.show(title: "Please wait", message: "We are processing your request", boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.spacing = 10
appearance.layout.enableShadow = false
appearance.layout.width = 250.0
appearance.layout.backgroundColor = UIColor.white

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.position = BoxIconPosition.centerBelowTitle

appearance.icon.loading.imageName = "loadingPurple"

// Animation
appearance.animation = BoxAnimationType.fade

Loading #8

Show Box:

DialogBox.show(title: "Please wait...", message: "Processing your request", boxApp: appearance)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.enableShadow = false
appearance.layout.width = 300.0
appearance.layout.backgroundColor = UIColor.white

// Title
appearance.title.textAlignment = NSTextAlignment.left

// Message
appearance.message.textAlignment = NSTextAlignment.left

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.7)

// Icon
appearance.icon.type = BoxIconType.loading
appearance.icon.position = BoxIconPosition.leftBesideMessage
appearance.icon.loading.imageName = "loadingPurple"

// Animation
appearance.animation = BoxAnimationType.fade

Screen message #1

Show Box:

DialogBox.show(title: nil, message: "Sorry we couldn't find any matches for search", boxApp: appearance, superView: self.view)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.enableShadow = false
appearance.layout.width = Float(UIScreen.main.bounds.size.width-40)
appearance.layout.backgroundColor = UIColor.clear

// Background
appearance.containerBackground.tapToDismiss = true
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.white

// Message
appearance.message.font = UIFont.boldSystemFont(ofSize: 16.0)
appearance.message.textColor = UIColor.darkGray

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "search"
appearance.icon.size = CGSize(width: 100, height: 100)

// Animation
appearance.animation = BoxAnimationType.none

Screen Message #2

Show Box:

DialogBox.show(title: nil, message: "Internet connection not found", superView: self.view , boxApp: appearance, buttonTitle: "Try Again", buttonAppearance: nil){ 
     print("Pressed Try Again")
}

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.enableShadow = false
appearance.layout.width = Float(UIScreen.main.bounds.size.width-40)
appearance.layout.backgroundColor = UIColor.clear

// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.white

// Message
appearance.message.font = UIFont.boldSystemFont(ofSize: 16.0)
appearance.message.textColor = UIColor.darkGray

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "wifi"
appearance.icon.size = CGSize(width: 100, height: 100)

// Animation
appearance.animation = BoxAnimationType.none

// Button
appearance.button.containerMargin = "80|0|80|0"
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)
appearance.button.bottomPosition.cornerRadius = 20.0
appearance.button.bottomPosition.maximumNoOfButtonsInSingleRow = 1
appearance.button.backgroundColor = UIColor.init(red: 0.0, green: 165.0/255.0, blue: 218.0/255.0, alpha: 1.0)

Screen Message #3

Show Box:

DialogBox.show(title: "You have no podcast", message: "Subscribe to a podcast or download episodes to add them to Unplayed.",superView: self.view , boxApp: appearance, buttonTitle: "Show Featured Podcast", buttonAppearance: nil) {
     print("Button Pressed")
}

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.center
appearance.positionMargin = 20
appearance.autoDismiss = true

// Layout
appearance.layout.padding = 10
appearance.layout.enableShadow = false
appearance.layout.width = Float(UIScreen.main.bounds.size.width-40)
appearance.layout.backgroundColor = UIColor.clear

// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.white

// Title
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)

// Message
appearance.message.font = UIFont.systemFont(ofSize: 16.0)
appearance.message.textColor = UIColor.darkGray

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.image.name = "podcast"
appearance.icon.size = CGSize(width: 100, height: 100)

// Animation
appearance.animation = BoxAnimationType.none

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)
appearance.button.bottomPosition.cornerRadius = 20.0
appearance.button.bottomPosition.maximumNoOfButtonsInSingleRow = 1
appearance.button.textColor = UIColor.init(red: 127.0/255.0, green: 34.0/255.0, blue: 185.0/255.0, alpha: 1.0)
appearance.button.backgroundColor = UIColor.clear
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 16.0)

Screen Message #4

Show Box:

DialogBox.show(title: "Success", message: "Your profile has been created successfully.", boxApp: appearance, buttonTitle: "Ok", buttonAppearance: nil, actionBlock: nil)

Box Settings:

var appearance = BoxAppearance()

// Layout
appearance.layout.cornerRadius = 5.0
appearance.layout.width = Float(UIScreen.main.bounds.size.width - CGFloat(40.0))
appearance.layout.backgroundColor = UIColor.clear
appearance.layout.enableShadow = false

// Title
appearance.title.textColor = UIColor.darkGray
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)
appearance.title.textColor = UIColor.init(red: 23.0/255.0, green: 76.0/255.0, blue: 43.0/255.0, alpha: 1.0)

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.font = UIFont.systemFont(ofSize: 16.0)
appearance.message.textColor = UIColor.init(red: 23.0/255.0, green: 76.0/255.0, blue: 43.0/255.0, alpha: 1.0)
appearance.message.margin = "0|0|0|20"

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.size = CGSize(width: 100, height: 100)
appearance.icon.image.name = "successWhite"
appearance.icon.position = BoxIconPosition.topCenter
appearance.icon.margin = "0|0|0|80"

// Animation
appearance.animation = BoxAnimationType.none

appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.init(red: 100.0/255.0, green: 208.0/255.0, blue: 44.0/255.0, alpha: 1.0)

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)
appearance.button.textColor = UIColor.darkGray
appearance.button.backgroundColor = UIColor.white
appearance.button.bottomPosition.cornerRadius = 3.0
appearance.button.containerMargin = "50|0|50|0"

Screen Message #5

Show Box:

DialogBox.show(title: "Welcome John!", message: "Your profile has been created successfully.", boxApp: appearance, buttonTitle: "Continue!", buttonAppearance: nil, actionBlock: nil)

Box Settings:

var appearance = BoxAppearance()

appearance.position = BoxPosition.top
appearance.positionMargin = 0

// Layout
appearance.layout.padding = 0
appearance.layout.cornerRadius = 5.0
appearance.layout.width = Float(UIScreen.main.bounds.size.width)
appearance.layout.backgroundColor = UIColor.clear
appearance.layout.enableShadow = false

// Title
appearance.title.textColor = UIColor.init(red: 10.0/255.0, green: 9.0/255.0, blue: 79.0/255.0, alpha: 1.0)
appearance.title.textAlignment = NSTextAlignment.left
appearance.title.font = UIFont.boldSystemFont(ofSize: 17.0)
appearance.title.margin = "20|30|0|0"

// Message
appearance.message.textColor = UIColor.darkGray
appearance.message.textAlignment = NSTextAlignment.left
appearance.message.font = UIFont.systemFont(ofSize: 16.0)
appearance.message.margin = "20|0|0|20"

// Icon
appearance.icon.type = BoxIconType.image
appearance.icon.size = CGSize(width: 100, height: 100)
appearance.icon.image.name = "successWhite"
appearance.icon.position = BoxIconPosition.topCenter
appearance.icon.backgroundColor = UIColor.init(red: 100.0/255.0, green: 208.0/255.0, blue: 44.0/255.0, alpha: 1.0)
appearance.icon.padding = "\((Float(UIScreen.main.bounds.size.width) - 100)/2)|100|\((Float(UIScreen.main.bounds.size.width) - 100)/2)|100"

// Animation
appearance.animation = BoxAnimationType.none

// Background
appearance.containerBackground.style = BoxBackgroundStyle.customColor
appearance.containerBackground.color = UIColor.white

// Button
appearance.button.titleFont = UIFont.boldSystemFont(ofSize: 17.0)
appearance.button.textColor = UIColor.white
appearance.button.backgroundColor = UIColor.init(red: 177.0/255.0, green: 209.0/255.0, blue: 6.0/255.0, alpha: 1.0)
appearance.button.bottomPosition.cornerRadius = 3.0
appearance.button.containerMargin = "70|40|70|0"