added more documentation
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
f398dcf9a8
commit
c8ee289640
@ -81,6 +81,8 @@ open class CheckboxGroup: SelectorGroupHandlerBase<CheckboxItem> {
|
||||
}
|
||||
|
||||
private var _showError: Bool = false
|
||||
|
||||
/// Whether not to show the error.
|
||||
open var showError: Bool {
|
||||
get { _showError }
|
||||
set {
|
||||
|
||||
@ -28,8 +28,10 @@ open class CheckboxItem: SelectorItemBase<Checkbox> {
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
// 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() }}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -39,12 +39,14 @@ open class Icon: View {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
/// UIImageView used to render the icon.
|
||||
open var imageView = UIImageView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.contentMode = .scaleAspectFill
|
||||
$0.clipsToBounds = true
|
||||
}
|
||||
|
||||
/// Color of the icon.
|
||||
open var color: UIColor = VDSColor.paletteBlack {
|
||||
didSet {
|
||||
if let hex = color.hexString, !UIColor.isVDSColor(color: color) {
|
||||
@ -53,8 +55,14 @@ open class Icon: View {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
/// Size of the icon.
|
||||
open var size: Size = .medium { didSet { setNeedsUpdate() }}
|
||||
|
||||
/// This will be used to render the icon with corresponding name.
|
||||
open var name: Name? { didSet { setNeedsUpdate() }}
|
||||
|
||||
/// A custom size of the icon.
|
||||
open var customSize: Int? { didSet { setNeedsUpdate() }}
|
||||
|
||||
/// The natural size for the receiving view, considering only properties of the view itself.
|
||||
|
||||
@ -10,6 +10,20 @@ import UIKit
|
||||
import VDSColorTokens
|
||||
|
||||
extension Icon {
|
||||
|
||||
/// A representation that will be used to render the icon with corresponding name.
|
||||
///
|
||||
/// A Icon.Name will only show up as a selection if the developer has created one and added to the Icon.Name namespace.
|
||||
/// ```
|
||||
/// /// add the new Icon.Name to the namespace.
|
||||
/// extension Icon.Name {
|
||||
/// public static let foo = Name(name: "foo-image")
|
||||
/// }
|
||||
///
|
||||
/// /// use the new Icon.Name you just created.
|
||||
/// let icon = Icon()
|
||||
/// icon.name = .foo
|
||||
/// ```
|
||||
public struct Name: RawRepresentable {
|
||||
public typealias RawValue = String
|
||||
public var rawValue: String
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
extension Icon {
|
||||
/// Enum for a preset height and width for the icon.
|
||||
public enum Size: String, CaseIterable {
|
||||
case xsmall
|
||||
case small
|
||||
|
||||
Loading…
Reference in New Issue
Block a user