Latest 1.0.0
License MIT
Platforms ios 9.0

JPAlertController is Swift alert all customizable. It’s usage look like UIAlertController usage.

Using JPAlertController you can customize every text in your alert just sending some options in the constructor.




  • iOS 9.0+
  • Xcode 8.1+
  • Swift 3.0+


It’s usage is very similar to UIAlertController. The difference is that is possible to pass options to configure your text as you want. These options need to be NSAttributedString attributes. So is possible to use:

  • NSFontAttributeName
  • NSParagraphStyleAttributeName
  • NSForegroundColorAttributeName
  • NSBackgroundColorAttributeName
  • NSLigatureAttributeName
  • NSKernAttributeName
  • NSStrikethroughStyleAttributeName
  • NSUnderlineStyleAttributeName
  • NSStrokeColorAttributeName
  • NSStrokeWidthAttributeName
  • NSShadowAttributeName
  • NSTextEffectAttributeName
  • NSAttachmentAttributeName
  • NSLinkAttributeName
  • NSBaselineOffsetAttributeName
  • NSBaselineOffsetAttributeName

  • and so on.
let titleOptions = [ NSFontAttributeName: UIFont(name: "Chalkduster", size: 18.0)!, NSForegroundColorAttributeName: ]

let messageOptions = [ NSFontAttributeName: UIFont(name: "Chalkduster", size: 14.0)!, NSForegroundColorAttributeName: ]

let alert = JPAlertController(title: "Alert", message: "This is a customizable Alert", titleOptions: titleOptions, messageOptions: messageOptions)

let okAction = JPAlertAction(title: "OK", titleOptions: titleOptions) { action in
    print("OK action")

alert.addAction(action: okAction)

let cancelOptions = [ NSFontAttributeName: UIFont(name: "Chalkduster", size: 14.0)!, NSForegroundColorAttributeName: ]

let cancelAction = JPAlertAction(title: "Cancel", titleOptions: cancelOptions) { action in
  print("Cancel action")

alert.addAction(action: cancelAction)

self.present(alert, animated: true, completion: nil)



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

pod 'JPAlertController'


Just copy and paste the files inside source code folder into your project.


  • Add separators
  • Let it be able to customize the background
  • Let it be able to customize the viewController’s background


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

Latest podspec

    "name": "JPAlertController",
    "version": "1.0.0",
    "summary": "An AlertController all customizable written in Swift 3.",
    "description": ""An AlertController all customizable written in Swift 3."",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "cs-joao-souza": "[email protected]"
    "platforms": {
        "ios": "9.0"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "source_files": "JPAlertController/Source Code/*.swift",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This