vds_ios/VDS/Components/Tooltip/ToolTipLaunchable.swift
Matt Bruce f6af646d09 refactored tooltip/label to use protocol
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-04-14 14:54:24 -05:00

28 lines
859 B
Swift

//
// ToolTipLaunchable.swift
// VDS
//
// Created by Matt Bruce on 4/14/23.
//
import Foundation
import UIKit
public protocol TooltipLaunchable { }
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)
}
}
}