vds_ios/VDS/Protocols/ViewProtocol.swift
Matt Bruce ce9e64da0f updated comments
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-08-04 10:22:31 -05:00

29 lines
660 B
Swift

//
// ViewProtocol.swift
// VDS
//
// Created by Matt Bruce on 7/22/22.
//
import Foundation
import UIKit
public protocol ViewProtocol {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
func setup()
/// Used to update any Accessibility properties.
func updateAccessibility()
}
extension ViewProtocol where Self: UIView {
/// Helper method for removing a superview and updating Self.
public func removeFromSuperview(_ view: UIView){
if view.superview != nil {
view.removeFromSuperview()
setNeedsDisplay()
}
}
}