vds_ios/VDS/Components/Tooltip/TooltipLaunchable.swift
Matt Bruce 1dd626d766 refactored tooltip to use a model
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-09-13 17:38:04 -05:00

29 lines
881 B
Swift

//
// ToolTipLaunchable.swift
// VDS
//
// Created by Matt Bruce on 4/14/23.
//
import Foundation
import UIKit
public protocol TooltipLaunchable {
func presentTooltip(surface: Surface, model: Tooltip.TooltipModel, presenter: UIView?)
}
extension TooltipLaunchable {
public func presentTooltip(surface: Surface, model: Tooltip.TooltipModel, presenter: UIView? = nil) {
if let presenting = UIApplication.topViewController() {
let tooltipViewController = TooltipAlertViewController(nibName: nil, bundle: nil).with {
$0.surface = surface
$0.model = model
$0.presenter = presenter
$0.modalPresentationStyle = .overCurrentContext
$0.modalTransitionStyle = .crossDissolve
}
presenting.present(tooltipViewController, animated: true)
}
}
}