1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import Foundation
- public class AlertController: AlertViewController {
-
- public fileprivate(set) var alertView: AlertView
-
- override public var animationView: UIView? {
- return alertView
- }
-
- public var titleLabel: UILabel? {
- return alertView.titleLabel
- }
-
- public var messageLabel: UILabel? {
- return alertView.messageLabel
- }
-
- public var cancelItem: AlertItem? {
- return alertView.cancelItem
- }
-
- public var confirmItem: AlertItem? {
- return alertView.confirmItem
- }
-
-
- public init(title: String = "", message: String = "", contentView: UIView? = nil) {
- alertView = .default
- alertView.title = title
- alertView.message = message
- alertView.contentView = contentView
- super.init(style: .alert)
- }
-
- required public init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- }
- public extension AlertController {
- func addAlertAction(_ action: AlertAction) {
- alertView.addAlertAction(action)
- }
- }
|