vds_ios/VDS/Protocols/ViewProtocol.swift
Matt Bruce 16ad138559 added helper function for labels
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-03-07 09:31:24 -06:00

29 lines
616 B
Swift

//
// ViewProtocol.swift
// VDS
//
// Created by Matt Bruce on 7/22/22.
//
import Foundation
import UIKit
public protocol ViewProtocol {
// Can setup ui here. Should be called in the initialization functions.
func setup()
}
extension ViewProtocol where Self: UIView {
public func removeFromSuperview(_ view: UIView){
if view.superview != nil {
view.removeFromSuperview()
setNeedsDisplay()
}
}
public func accessibilityLabel(for views: [UIView]) -> String? {
return views.compactMap({$0.accessibilityLabel}).joined(separator: " ")
}
}