Skip to content
Cool Alert View by MAS
Swift Shell Ruby Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


CI Status Version License Platform


A simple and customizable Alert View and easy to use. What does it offer ?

  • custom title bar
  • custom footer button
  • custom view body
  • custom close button


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

How to use

Initialize the MASCoolAlertView

self.newAlert = MASCoolAlertView(height: 200, width: 200, cornerRadius: 10, backgroundColor: .yellow)

add to the subview


set the title bar

self.newAlert!.setTitleBar(height: 50, backgroundColor: .green, titleColor: .blue, titleText: "Title Text")

set the title bar border

self.newAlert!.setTitleBarBorder(borderWidth: 1, borderColor: .red)

create the close button

self.newAlert!.createCloseButton(tintColor: .red, imageNamed: "close-circular.png", buttonSize: 24)

set the footer button

self.newAlert!.setFooterButton(buttonText: "Close", buttonColor: .black, buttonTextColor: .red, height: 50)

set the custom footer button handler

self.newAlert!.handleBottomButton = handleButton

set the body view using custom body

let newView = UIView(frame: CGRect(x: 10, y: self.newAlert!.topView!.bounds.maxY + 10, width: self.newAlert!.bounds.height - 20, height: self.newAlert!.bounds.height/3))
newView.backgroundColor = .blue

set the body content either using bodyText -- default -- or using custom body above

self.newAlert!.setBodyContent(bodyBackgroundColor: .clear, bodyTextColor: .black, bodyText: "Hello This is Text Field", bodyView: nil)

show the alert with duration delay and options effect (curveEaseIn, curveEaseOut, curveEaseInOut, specialCurve)

self.newAlert!.show(duration: 0.5, delay: 0.0, options: .curveEaseIn)


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

pod 'MASCoolAlertView'


abadikaka, Michael Abadi Santoso,


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

You can’t perform that action at this time.