// // ToolTipLaunchable.swift // VDS // // Created by Matt Bruce on 4/14/23. // import Foundation import UIKit public protocol TooltipLaunchable { func presentTooltip(surface: Surface, title: String, content: String, closeButtonText: String) } extension TooltipLaunchable { public func presentTooltip(surface: Surface, title: String, content: String, closeButtonText: String = "Close") { if let presenting = UIApplication.topViewController() { let tooltipViewController = TooltipAlertViewController(nibName: nil, bundle: nil).with { $0.surface = surface $0.titleText = title $0.contentText = content $0.closeButtonText = closeButtonText $0.modalPresentationStyle = .overCurrentContext $0.modalTransitionStyle = .crossDissolve } presenting.present(tooltipViewController, animated: true) } } }