Created
October 10, 2018 08:40
-
-
Save IsaAliev/05e77c2d74e501e7c34db91699f6bfd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class AlertBuilder { | |
static func buildAlertController(for model: AlertModel) -> UIAlertController { | |
let controller = UIAlertController(title: model.title, message: model.message, preferredStyle: model.prefferedStyle) | |
model.actionModels.forEach({ controller.addAction(UIAlertAction(title: $0.title, style: $0.style, handler: $0.handler)) }) | |
return controller | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment