diff --git a/VDS/Classes/SelectorBase.swift b/VDS/Classes/SelectorBase.swift index 3dbde5c4..aa1d8cea 100644 --- a/VDS/Classes/SelectorBase.swift +++ b/VDS/Classes/SelectorBase.swift @@ -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() { } } diff --git a/VDS/Components/Checkbox/Checkbox.swift b/VDS/Components/Checkbox/Checkbox.swift index 564979f3..99f02a58 100644 --- a/VDS/Components/Checkbox/Checkbox.swift +++ b/VDS/Components/Checkbox/Checkbox.swift @@ -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 { diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 163d649a..2a4bd73e 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -38,7 +38,7 @@ open class CheckboxGroup: SelectorGroupHandlerBase { 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 { } } - /// 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 { diff --git a/VDS/Components/Checkbox/CheckboxItem.swift b/VDS/Components/Checkbox/CheckboxItem.swift index 3abec418..12670b2f 100644 --- a/VDS/Components/Checkbox/CheckboxItem.swift +++ b/VDS/Components/Checkbox/CheckboxItem.swift @@ -31,13 +31,12 @@ open class CheckboxItem: SelectorItemBase { // 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 { diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index 670ec2ea..51fbb992 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -39,6 +39,7 @@ open class RadioBoxGroup: SelectorGroupSelectedHandlerBase { //-------------------------------------------------- // 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 { } } + /// Array of ``RadioBoxItemModel`` that will be used to build the selectorViews of type ``RadioBoxItem``. open var selectorModels: [RadioBoxItemModel]? { didSet { if let selectorModels { diff --git a/VDS/Components/RadioBox/RadioBoxItem.swift b/VDS/Components/RadioBox/RadioBoxItem.swift index ff745df0..0ca82fe2 100644 --- a/VDS/Components/RadioBox/RadioBoxItem.swift +++ b/VDS/Components/RadioBox/RadioBoxItem.swift @@ -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() diff --git a/VDS/Components/RadioButton/RadioButton.swift b/VDS/Components/RadioButton/RadioButton.swift index 416f89db..27db5e3c 100644 --- a/VDS/Components/RadioButton/RadioButton.swift +++ b/VDS/Components/RadioButton/RadioButton.swift @@ -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) } diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 91b32412..82c8ef66 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -42,6 +42,7 @@ open class RadioButtonGroup: SelectorGroupSelectedHandlerBase { //-------------------------------------------------- // 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 { } } + /// Array of ``RadioButtonItemModel`` that will be used to build the selectorViews of type ``RadioButtonItem``. open var selectorModels: [RadioButtonItemModel]? { didSet { if let selectorModels { diff --git a/VDS/Components/RadioButton/RadioButtonItem.swift b/VDS/Components/RadioButton/RadioButtonItem.swift index 14ed50fb..809f9a18 100644 --- a/VDS/Components/RadioButton/RadioButtonItem.swift +++ b/VDS/Components/RadioButton/RadioButtonItem.swift @@ -29,7 +29,7 @@ open class RadioButtonItem: SelectorItemBase { //-------------------------------------------------- // 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 } diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 8d3503a0..5fdb92bc 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -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,39 +86,40 @@ 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. + /// When true, Tabs will have border line. If false is passed then the border line won't be visible. open var borderLine: Bool = true { didSet { setNeedsUpdate() } } - ///It will fill the Tabs to the width of the compoent and all Tabs will be in equal width when orientation is horizontal. This is recommended when there are no more than 2-3 tabs. + /// It will fill the Tabs to the width of the compoent and all Tabs will be in equal width when orientation is horizontal. This is recommended when there are no more than 2-3 tabs. open var fillContainer: Bool = false { didSet { setNeedsUpdate() } } - ///When true, Tabs will be sticky to top of page, when orientation is vertical. + /// When true, Tabs will be sticky to top of page, when orientation is vertical. open var indicatorFillTab: Bool = false { didSet { setNeedsUpdate() } } - ///Sets the Position of the Selected/Hover Border Accent for All Tabs, only for Horizontal Orientation + /// Sets the Position of the Selected/Hover Border Accent for All Tabs, only for Horizontal Orientation open var indicatorPosition: IndicatorPosition = .bottom { didSet { setNeedsUpdate() } } - ///Minimum Width for All Tabs, when orientation is horizontal. + /// Minimum Width for All Tabs, when orientation is horizontal. open var minWidth: CGFloat = 44.0 { didSet { setNeedsUpdate() } } - ///If set to 'scroll', Tabs can be overflow and scrollable. With 'none', tabs will not overflow and labels will be wrapped to multiple lines if the label text is long. + /// If set to 'scroll', Tabs can be overflow and scrollable. With 'none', tabs will not overflow and labels will be wrapped to multiple lines if the label text is long. open var overflow: Overflow = .scroll { didSet { setNeedsUpdate() } } - ///The initial Selected Tab's index and is set once a Tab is clicked + /// The initial Selected Tab's index and is set once a Tab is clicked open var selectedIndex: Int = 0 { didSet { setNeedsUpdate() } } - ///Determines the size of the Tabs TextStyle + /// Determines the size of the Tabs TextStyle open var size: Size = .medium { didSet { setNeedsUpdate() } } - ///When true, Tabs will be sticky to top of page, when orientation is vertical. + /// 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] = [] //-------------------------------------------------- diff --git a/VDS/Components/Toggle/Toggle.swift b/VDS/Components/Toggle/Toggle.swift index b44e3f4e..da7308bf 100644 --- a/VDS/Components/Toggle/Toggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -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) diff --git a/VDS/Components/Toggle/ToggleView.swift b/VDS/Components/Toggle/ToggleView.swift index 7601b8ae..a504d61c 100644 --- a/VDS/Components/Toggle/ToggleView.swift +++ b/VDS/Components/Toggle/ToggleView.swift @@ -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)