more comments

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-28 18:40:10 -05:00
parent ba9e5f912f
commit 5f3c872092
12 changed files with 33 additions and 27 deletions

View File

@ -130,6 +130,7 @@ open class SelectorBase: Control, SelectorControlable {
super.updateAccessibility()
}
/// This will change the state of the Selector and execute the actionBlock if provided.
open func toggle() { }
}

View File

@ -63,7 +63,7 @@ open class Checkbox: SelectorBase {
selectorColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forState: .selected)
}
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
/// This will change the state of the Selector and execute the actionBlock if provided.
open override func toggle() {
//removed error
if showError && isSelected == false {

View File

@ -38,7 +38,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
return selected
}
/// Arrary of ``CheckboxItem`` within this group.
/// Array of ``CheckboxItem`` that the user will have the ability to select from.
open override var selectorViews: [CheckboxItem] {
willSet {
mainStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
@ -54,7 +54,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
}
}
/// Arrary of ``CheckboxItemModel`` within this group that are selected.
/// Array of ``CheckboxItemModel`` that will be used to build the selectorViews of type ``CheckboxItem``.
open var selectorModels: [CheckboxItemModel]? {
didSet {
if let selectorModels {

View File

@ -31,13 +31,12 @@ open class CheckboxItem: SelectorItemBase<Checkbox> {
// MARK: - Public Properties
//--------------------------------------------------
/// Whether or not there is animation when the checkbox changes state from non-selected to a selected state.
open var isAnimated: Bool = false { didSet { setNeedsUpdate() }}
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
/// This will change the state of the Selector and execute the actionBlock if provided.
open override func toggle() {
//removed error
if showError && isSelected == false {

View File

@ -39,6 +39,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase<RadioBoxItem> {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
/// Array of ``RadioBoxItem`` that the user will have the ability to select from.
public override var selectorViews: [RadioBoxItem] {
willSet {
mainStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
@ -55,6 +56,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase<RadioBoxItem> {
}
}
/// Array of ``RadioBoxItemModel`` that will be used to build the selectorViews of type ``RadioBoxItem``.
open var selectorModels: [RadioBoxItemModel]? {
didSet {
if let selectorModels {

View File

@ -229,7 +229,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
setNeedsUpdate()
}
/// This will radioBox the state of the Selector and execute the actionBlock if provided.
/// This will change the state of the Selector and execute the actionBlock if provided.
open func toggle() {
//removed error
isSelected.toggle()

View File

@ -30,9 +30,9 @@ open class RadioButton: SelectorBase {
}
//--------------------------------------------------
// MARK: - Public Properties
// MARK: - Private Properties
//--------------------------------------------------
open var selectedSize = CGSize(width: 10, height: 10) { didSet { setNeedsUpdate() }}
private var selectorSize = CGSize(width: 10, height: 10)
//--------------------------------------------------
// MARK: - Overrides
@ -58,6 +58,7 @@ open class RadioButton: SelectorBase {
}
/// This will change the state of the Selector and execute the actionBlock if provided.
open override func toggle() {
guard !isSelected else { return }
@ -90,11 +91,11 @@ open class RadioButton: SelectorBase {
layer.borderWidth = VDSFormControls.widthBorder
if shapeLayer == nil {
let selectedBounds = selectedSize
let selectedBounds = selectorSize
let bezierPath = UIBezierPath(ovalIn: CGRect(x: (bounds.width - selectedBounds.width) / 2,
y: (bounds.height - selectedBounds.height) / 2,
width: selectedSize.width,
height: selectedSize.height))
width: selectorSize.width,
height: selectorSize.height))
let shapeLayer = CAShapeLayer()
self.shapeLayer = shapeLayer
shapeLayer.frame = bounds
@ -107,7 +108,7 @@ open class RadioButton: SelectorBase {
// MARK: AppleGuidlinesTouchable
extension RadioButton: AppleGuidlinesTouchable {
/// Overrides to ensure that the touch point meets a minimum of 45 x 45.
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
Self.acceptablyOutsideBounds(point: point, bounds: bounds)
}

View File

@ -42,6 +42,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
/// Array of ``RadioButtonItem`` that the user will have the ability to select from.
public override var selectorViews: [RadioButtonItem] {
willSet {
mainStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
@ -58,6 +59,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase<RadioButtonItem> {
}
}
/// Array of ``RadioButtonItemModel`` that will be used to build the selectorViews of type ``RadioButtonItem``.
open var selectorModels: [RadioButtonItemModel]? {
didSet {
if let selectorModels {

View File

@ -29,7 +29,7 @@ open class RadioButtonItem: SelectorItemBase<RadioButton> {
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
/// This will checkbox the state of the Selector and execute the actionBlock if provided.
/// This will change the state of the Selector and execute the actionBlock if provided.
open override func toggle() {
guard !isSelected else { return }

View File

@ -51,7 +51,7 @@ open class Tabs: View {
}
}
//Type of behavior for Scrolling
/// Type of behavior for Scrolling
public enum Overflow: String, CaseIterable {
case scroll
case none
@ -86,7 +86,7 @@ open class Tabs: View {
/// A callback when the selectedIndex changes. Passes parameters (event, tabIndex).
open var onTabChange: ((Int) -> Void)?
//Determines the layout of the Tabs, defaults to horizontal
/// Determines the layout of the Tabs, defaults to horizontal
open var orientation: Orientation = .horizontal { didSet { if oldValue != orientation { setNeedsUpdate() } } }
/// When true, Tabs will have border line. If false is passed then the border line won't be visible.
@ -116,9 +116,10 @@ open class Tabs: View {
/// When true, Tabs will be sticky to top of page, when orientation is vertical.
open var sticky: Bool = false { didSet { setNeedsUpdate() } }
///Model of the Tabs you are wanting to show.
/// Array of ``TabModel`` you are wanting to show.
open var tabModels: [TabModel] = [] { didSet { updateTabItems() } }
/// Array of ``Tab`` views for the Tabs.
open var tabViews: [Tab] = []
//--------------------------------------------------

View File

@ -238,7 +238,7 @@ open class Toggle: Control, Changeable {
}
}
/// This will toggle the state of the Toggle
/// This will change the state of the Selector and execute the actionBlock if provided.
open func toggle() {
isOn.toggle()
sendActions(for: .valueChanged)

View File

@ -183,7 +183,7 @@ open class ToggleView: Control, Changeable {
accessibilityLabel = "Toggle"
}
/// This will toggle the state of the Toggle and execute the actionBlock if provided.
/// This will change the state of the Selector and execute the actionBlock if provided.
open func toggle() {
isOn.toggle()
sendActions(for: .valueChanged)