Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created October 10, 2018 08:40
Show Gist options
  • Save IsaAliev/05e77c2d74e501e7c34db91699f6bfd7 to your computer and use it in GitHub Desktop.
Save IsaAliev/05e77c2d74e501e7c34db91699f6bfd7 to your computer and use it in GitHub Desktop.
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