Open ghost opened 8 years ago
Wouldn't it better to make the class a singleton so that there is only one instance. You would then just call functions:
SweetAlert.sharedInstance.showAlert("Here's a message!")
Just need the: static let sharedInstance = SweetAlert()
static let sharedInstance = SweetAlert()
and make the init() private.
init()
Very nice work, thanks!!
Wouldn't it better to make the class a singleton so that there is only one instance. You would then just call functions:
SweetAlert.sharedInstance.showAlert("Here's a message!")
Just need the:
static let sharedInstance = SweetAlert()
and make the
init()
private.Very nice work, thanks!!