codestergit / SweetAlert-iOS

Live animated Alert View for iOS written in Swift
MIT License
2.05k stars 303 forks source link

Make the class a singleton #28

Open ghost opened 8 years ago

ghost commented 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()

and make the init() private.

Very nice work, thanks!!