Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UIExtension: UIViewController {
- func prepareAlert(title: String, message: String) -> UIAlertController {
- let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
- alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
- return alert
- }
- }
- class FirstViewController: UIExtension {
- //somewhere inside used the following
- present(prepareAlert(title: "Error Validation", message: "invalid fields"), animated: true, completion: nil)
- }
Add Comment
Please, Sign In to add comment