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