Latest 0.1.4
Homepage https://github.com/pikachu987/PKCAlertView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

image
image
image
image
image

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


import PKCAlertView

let alertView = PKCAlertView("Title", message: "Message", bgColor: UIColor(red: 170/255, green: 170/255, blue: 170/255, alpha: 0.8))
self.view.pkc_addSubview(alertView)

alertView.addAlertButton("Default") { (type, text) in

}

alertView.addAlertView("OK") { (type, text) in

}

alertView.addAlertView("Cancel", rightText: "OK") { (type, text) in

}

alertView.addAlertView("Left", centerText: "Center", rightText: "Right", handler: { (type, text) in

})

let pkcAlertButton = PKCAlertButton("CustomButton")
pkcAlertButton.addTarget(self, action: #selector(self.defaultAction(_:)), for: .touchUpInside)
pkcAlertButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 19)
pkcAlertButton.backgroundColor = UIColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 1)
pkcAlertButton.highlightColor = UIColor(red: 210/255, green: 210/255, blue: 210/255, alpha: 1)

alertView.addAlertButton(pkcAlertButton, handler: { (type, text) in

})

let pkcAlertButton1 = PKCAlertButton("CustomLeftButton")
let pkcAlertButton2 = PKCAlertButton("CustomRightButton")
alertView.addAlertButton(pkcAlertButton1, rightButton: pkcAlertButton2, handler: { (type, text) in

})

let pkcAlertButton3 = PKCAlertButton("CustomLeftButton")
let pkcAlertButton4 = PKCAlertButton("CustomCenterButton")
let pkcAlertButton5 = PKCAlertButton("CustomRightButton")
alertView.addAlertButton(pkcAlertButton3, centerButton: pkcAlertButton4, rightButton: pkcAlertButton5, handler: { (type, text) in

})

alertView.animationType = .default
alertView.animationType = .alpha
alertView.animationType = .modal
alertView.animationTime = TimeInterval(0.5)

alertView.show()

Installation

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

pod "PKCAlertView"

Author

pikachu987, [email protected]

License

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

Latest podspec

{
    "name": "PKCAlertView",
    "version": "0.1.4",
    "summary": "A view that can have the same effect as a UIAlertController with addSubView in the view",
    "description": "In UIViewController, it is inconvenient for UIAlertController screen to come out when screen is changed. In order to get Alert screen from UIView, AlertView should let Alert come out of view from controller.",
    "homepage": "https://github.com/pikachu987/PKCAlertView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "pikachu987": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pikachu987/PKCAlertView.git",
        "tag": "0.1.4"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "PKCAlertView/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This