Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions SweetAlert/SweetAlert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,36 +205,30 @@ public class SweetAlert: UIViewController {
self.contentView = UIView()
}

public func showAlert(title: String) -> SweetAlert {
public func showAlert(title: String) {
self.showAlert(title, subTitle: nil, style: .None)
return self
}

public func showAlert(title: String, subTitle: String?, style: AlertStyle) -> SweetAlert {
public func showAlert(title: String, subTitle: String?, style: AlertStyle) {
self.showAlert(title, subTitle: subTitle, style: style, buttonTitle: "OK")
return self

}

public func showAlert(title: String, subTitle: String?, style: AlertStyle,buttonTitle: String, action: ((isOtherButton: Bool) -> Void)? = nil) -> SweetAlert {
public func showAlert(title: String, subTitle: String?, style: AlertStyle,buttonTitle: String, action: ((isOtherButton: Bool) -> Void)? = nil) {
self.showAlert(title, subTitle: subTitle, style: style, buttonTitle: buttonTitle,buttonColor: UIColor.colorFromRGB(0xAEDEF4))
userAction = action
return self
}

public func showAlert(title: String, subTitle: String?, style: AlertStyle,buttonTitle: String,buttonColor: UIColor,action: ((isOtherButton: Bool) -> Void)? = nil) -> SweetAlert {
public func showAlert(title: String, subTitle: String?, style: AlertStyle,buttonTitle: String,buttonColor: UIColor,action: ((isOtherButton: Bool) -> Void)? = nil) {
self.showAlert(title, subTitle: subTitle, style: style, buttonTitle: buttonTitle,buttonColor: buttonColor,otherButtonTitle:
nil)
userAction = action
return self
}

public func showAlert(title: String, subTitle: String?, style: AlertStyle,buttonTitle: String,buttonColor: UIColor,otherButtonTitle:
String?, action: ((isOtherButton: Bool) -> Void)? = nil) -> SweetAlert {
String?, action: ((isOtherButton: Bool) -> Void)? = nil) {
self.showAlert(title, subTitle: subTitle, style: style, buttonTitle: buttonTitle,buttonColor: buttonColor,otherButtonTitle:
otherButtonTitle,otherButtonColor: UIColor.redColor())
userAction = action
return self
}

public func showAlert(title: String, subTitle: String?, style: AlertStyle,buttonTitle: String,buttonColor: UIColor,otherButtonTitle:
Expand Down
1 change: 0 additions & 1 deletion SweetAlert/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import UIKit

class ViewController: UIViewController {

var alert = SweetAlert()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
Expand Down