Merge branch 'mbruce/bugfixes' into 'develop'
commented code for extensions See merge request BPHV_MIPS/vds_ios!96
This commit is contained in:
commit
e1bc533806
@ -1163,7 +1163,7 @@
|
|||||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 33;
|
CURRENT_PROJECT_VERSION = 34;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
@ -1200,7 +1200,7 @@
|
|||||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 33;
|
CURRENT_PROJECT_VERSION = 34;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
|||||||
@ -226,6 +226,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -75,6 +75,7 @@ open class Badge: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -278,6 +278,7 @@ open class BadgeIndicator: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -130,6 +130,7 @@ open class Button: ButtonBase, Useable {
|
|||||||
heightConstraint?.isActive = true
|
heightConstraint?.isActive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -135,6 +135,7 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open func reset() {
|
open func reset() {
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
surface = .light
|
surface = .light
|
||||||
|
|||||||
@ -87,6 +87,7 @@ open class TextLink: ButtonBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -79,6 +79,7 @@ open class TextLinkCaret: ButtonBase {
|
|||||||
accessibilityTraits = .link
|
accessibilityTraits = .link
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
iconPosition = .right
|
iconPosition = .right
|
||||||
|
|||||||
@ -253,6 +253,7 @@ open class ButtonIcon: Control {
|
|||||||
iconLayoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)])
|
iconLayoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -62,6 +62,7 @@ open class Icon: View {
|
|||||||
accessibilityTraits = .image
|
accessibilityTraits = .image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
color = VDSColor.paletteBlack
|
color = VDSColor.paletteBlack
|
||||||
|
|||||||
@ -111,6 +111,7 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
|||||||
|
|
||||||
open func setup() {}
|
open func setup() {}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open func reset() {
|
open func reset() {
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
surface = .light
|
surface = .light
|
||||||
|
|||||||
@ -40,6 +40,7 @@ open class Line: View {
|
|||||||
lineView.pinToSuperView()
|
lineView.pinToSuperView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
style = .primary
|
style = .primary
|
||||||
|
|||||||
@ -228,6 +228,7 @@ open class Notification: View {
|
|||||||
subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
|
subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
|
|
||||||
|
|||||||
@ -200,6 +200,7 @@ open class RadioBoxItem: Control, Changeable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -88,7 +88,8 @@ open class RadioSwatch: Control {
|
|||||||
fillView.width(fillSize.width)
|
fillView.width(fillSize.width)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -228,6 +228,7 @@ open class EntryField: Control, Changeable {
|
|||||||
return containerView
|
return containerView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
titleLabel.reset()
|
titleLabel.reset()
|
||||||
|
|||||||
@ -140,6 +140,7 @@ open class InputField: EntryField, UITextFieldDelegate {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
textField.text = ""
|
textField.text = ""
|
||||||
|
|||||||
@ -79,6 +79,7 @@ open class TextArea: EntryField {
|
|||||||
textView.delegate = self
|
textView.delegate = self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
textView.text = ""
|
textView.text = ""
|
||||||
|
|||||||
@ -189,6 +189,7 @@ open class TileContainer: Control {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -240,6 +240,7 @@ open class Tilelet: TileContainer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
aspectRatio = .none
|
aspectRatio = .none
|
||||||
|
|||||||
@ -196,6 +196,7 @@ open class TitleLockup: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -172,6 +172,7 @@ open class Toggle: Control, Changeable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -136,6 +136,7 @@ open class ToggleView: Control, Changeable {
|
|||||||
|
|
||||||
open override var intrinsicContentSize: CGSize { toggleSize }
|
open override var intrinsicContentSize: CGSize { toggleSize }
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -139,6 +139,7 @@ open class Tooltip: Control, TooltipLaunchable {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -77,6 +77,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Resets back to this objects default settings.
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
shouldUpdateView = false
|
shouldUpdateView = false
|
||||||
|
|||||||
@ -9,6 +9,10 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
extension NSAttributedString {
|
extension NSAttributedString {
|
||||||
|
|
||||||
|
/// Spacer in the form of a AttributedString.
|
||||||
|
/// - Parameter width: size of the space.
|
||||||
|
/// - Returns: AttributedString with the Space of the width you asked.
|
||||||
public static func spacer(for width: CGFloat) -> NSAttributedString {
|
public static func spacer(for width: CGFloat) -> NSAttributedString {
|
||||||
let spacerImage = UIImage()
|
let spacerImage = UIImage()
|
||||||
let spacerAttachment = NSTextAttachment()
|
let spacerAttachment = NSTextAttachment()
|
||||||
@ -20,7 +24,18 @@ extension NSAttributedString {
|
|||||||
|
|
||||||
extension NSMutableAttributedString {
|
extension NSMutableAttributedString {
|
||||||
|
|
||||||
|
/// This will used along with mutableText method to determine if you will use a ratio version of the lineHeight within a TextStyle if you have a scaled font being used.
|
||||||
public static var useScaledLineHeight: Bool = false
|
public static var useScaledLineHeight: Bool = false
|
||||||
|
|
||||||
|
/// Creates a MutableAttributedString for the text and other properties you have passed into the method.
|
||||||
|
/// - Parameters:
|
||||||
|
/// - text: Text you want to draw onscreen.
|
||||||
|
/// - textStyle: Style of Typography you want to render the Text.
|
||||||
|
/// - useScaledFont: Determines if you used a scaledFont or a normal Font from the TextStyle.
|
||||||
|
/// - textColor: Color of Text to render.
|
||||||
|
/// - alignment: Text alignment.
|
||||||
|
/// - lineBreakMode: LineBreak Mode.
|
||||||
|
/// - Returns: MutableAttributedString from al lof the properties you passed in to help render Text using non-standard properties.
|
||||||
public static func mutableText(for text: String, textStyle: TextStyle, useScaledFont: Bool = true, textColor: UIColor, alignment: NSTextAlignment = .left, lineBreakMode: NSLineBreakMode) -> NSMutableAttributedString {
|
public static func mutableText(for text: String, textStyle: TextStyle, useScaledFont: Bool = true, textColor: UIColor, alignment: NSTextAlignment = .left, lineBreakMode: NSLineBreakMode) -> NSMutableAttributedString {
|
||||||
|
|
||||||
//var for if you can scale or not
|
//var for if you can scale or not
|
||||||
|
|||||||
@ -125,6 +125,8 @@ extension UIColor {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Convert your UIColor to a VDSColor
|
||||||
|
/// - Returns: VDSColor enum that matches the hexString for this UIColor
|
||||||
public func toVDSColor() -> VDSColor? {
|
public func toVDSColor() -> VDSColor? {
|
||||||
guard let hex = hexString else { return nil }
|
guard let hex = hexString else { return nil }
|
||||||
let found = VDSColor.allCases.first{ $0.uiColor.hexString == hex }
|
let found = VDSColor.allCases.first{ $0.uiColor.hexString == hex }
|
||||||
|
|||||||
@ -9,6 +9,10 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
extension UIControl.State {
|
extension UIControl.State {
|
||||||
|
|
||||||
|
/// State for Error
|
||||||
public static var error = UIControl.State(rawValue: 1 << 16)
|
public static var error = UIControl.State(rawValue: 1 << 16)
|
||||||
|
|
||||||
|
/// State for Success
|
||||||
public static var success = UIControl.State(rawValue: 1 << 17)
|
public static var success = UIControl.State(rawValue: 1 << 17)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,9 @@ extension UIView {
|
|||||||
// MARK: - CALayer
|
// MARK: - CALayer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
extension CALayer {
|
extension CALayer {
|
||||||
|
|
||||||
|
/// Removes a sublayer of a specific name.
|
||||||
|
/// - Parameter layerName: Layer with the name you want to remove.
|
||||||
public func remove(layerName: String) {
|
public func remove(layerName: String) {
|
||||||
guard let sublayers = sublayers else {
|
guard let sublayers = sublayers else {
|
||||||
return
|
return
|
||||||
@ -90,6 +93,12 @@ extension CALayer {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
extension UIView {
|
extension UIView {
|
||||||
|
|
||||||
|
/// Adds a border to a specific sides with the parameters.
|
||||||
|
/// - Parameters:
|
||||||
|
/// - side: Side in which to add the border.
|
||||||
|
/// - width: Width of the border.
|
||||||
|
/// - color: Color of the border.
|
||||||
|
/// - offset: offset of the border.
|
||||||
public func addBorder(side: UIRectEdge, width: CGFloat, color: UIColor, offset: CGFloat = 0) {
|
public func addBorder(side: UIRectEdge, width: CGFloat, color: UIColor, offset: CGFloat = 0) {
|
||||||
let layerName = borderLayerName(for: side)
|
let layerName = borderLayerName(for: side)
|
||||||
layer.remove(layerName: layerName)
|
layer.remove(layerName: layerName)
|
||||||
@ -113,7 +122,8 @@ extension UIView {
|
|||||||
|
|
||||||
layer.addSublayer(borderLayer)
|
layer.addSublayer(borderLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Removes all of the borders addeding using the addBorder method.
|
||||||
public func removeBorders() {
|
public func removeBorders() {
|
||||||
layer.borderWidth = 0
|
layer.borderWidth = 0
|
||||||
layer.borderColor = nil
|
layer.borderColor = nil
|
||||||
|
|||||||
@ -21,6 +21,11 @@ extension UIView {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
extension UIView {
|
extension UIView {
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Pins each to the all 4 anchor points to a view.
|
||||||
|
/// - Parameters:
|
||||||
|
/// - view: View that you will be pinned within.
|
||||||
|
/// - edges: Insets for each side.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pin(_ view: UIView, with edges: UIEdgeInsets = UIEdgeInsets.zero) -> Self {
|
public func pin(_ view: UIView, with edges: UIEdgeInsets = UIEdgeInsets.zero) -> Self {
|
||||||
pinLeading(view.leadingAnchor, edges.left)
|
pinLeading(view.leadingAnchor, edges.left)
|
||||||
pinTrailing(view.trailingAnchor, edges.right)
|
pinTrailing(view.trailingAnchor, edges.right)
|
||||||
@ -30,6 +35,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
|
||||||
|
/// Pins each to the all 4 anchor points to the view you are set within.
|
||||||
|
/// - Parameter edges: Insets for each side.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinToSuperView(_ edges: UIEdgeInsets = UIEdgeInsets.zero) -> Self {
|
public func pinToSuperView(_ edges: UIEdgeInsets = UIEdgeInsets.zero) -> Self {
|
||||||
if let superview {
|
if let superview {
|
||||||
pin(superview, with: edges)
|
pin(superview, with: edges)
|
||||||
@ -44,34 +53,52 @@ extension UIView {
|
|||||||
extension UIView {
|
extension UIView {
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a heightAnchor.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func height(_ constant: CGFloat) -> Self {
|
public func height(_ constant: CGFloat) -> Self {
|
||||||
height(constant: constant)
|
height(constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a heightAnchor where the height constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func heightGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
public func heightGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
||||||
heightGreaterThanEqualTo(constant: constant)
|
heightGreaterThanEqualTo(constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a heightAnchor where the height constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func heightLessThanEqualTo(_ constant: CGFloat) -> Self {
|
public func heightLessThanEqualTo(_ constant: CGFloat) -> Self {
|
||||||
heightLessThanEqualTo(constant: constant)
|
heightLessThanEqualTo(constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a heightAnchor for the constant passed into the method.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func height(constant: CGFloat) -> NSLayoutConstraint {
|
public func height(constant: CGFloat) -> NSLayoutConstraint {
|
||||||
heightAnchor.constraint(equalToConstant: constant).activate()
|
heightAnchor.constraint(equalToConstant: constant).activate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a heightAnchor where the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func heightGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
public func heightGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||||
heightAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
heightAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a heightAnchor where the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func heightLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
public func heightLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||||
heightAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
heightAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
||||||
}
|
}
|
||||||
@ -84,34 +111,52 @@ extension UIView {
|
|||||||
extension UIView {
|
extension UIView {
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a widthAnchor.
|
||||||
|
/// - Parameter constant: Width Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func width(_ constant: CGFloat) -> Self {
|
public func width(_ constant: CGFloat) -> Self {
|
||||||
width(constant: constant)
|
width(constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a widthAnchor where the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func widthGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
public func widthGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
||||||
widthGreaterThanEqualTo(constant: constant)
|
widthGreaterThanEqualTo(constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a widthAnchor where the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func widthLessThanEqualTo(_ constant: CGFloat) -> Self {
|
public func widthLessThanEqualTo(_ constant: CGFloat) -> Self {
|
||||||
widthLessThanEqualTo(constant: constant)
|
widthLessThanEqualTo(constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a widthAnchor for the constant passed into the method.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func width(constant: CGFloat) -> NSLayoutConstraint {
|
public func width(constant: CGFloat) -> NSLayoutConstraint {
|
||||||
widthAnchor.constraint(equalToConstant: constant).activate()
|
widthAnchor.constraint(equalToConstant: constant).activate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a widthAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func widthGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
public func widthGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||||
widthAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
widthAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a widthAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func widthLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
public func widthLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||||
widthAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
widthAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
||||||
}
|
}
|
||||||
@ -123,29 +168,48 @@ extension UIView {
|
|||||||
extension UIView {
|
extension UIView {
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTop(_ constant: CGFloat = 0.0) -> Self {
|
public func pinTop(_ constant: CGFloat = 0.0) -> Self {
|
||||||
return pinTop(nil, constant)
|
return pinTop(nil, constant)
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor to a specific YAxisAnchor.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the topAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTop(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinTop(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinTop(anchor: anchor, constant: constant)
|
pinTop(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor to a specific YAxisAnchor passed in using a lessThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the topAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTopLessThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinTopLessThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinBottomLessThanOrEqualTo(anchor: anchor, constant: constant)
|
pinTopLessThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor to a specific YAxisAnchor passed in using a greaterThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the topAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTopGreaterThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinTopGreaterThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinTopGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
pinTopGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor for the constant passed into the method.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the topAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinTop(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinTop(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.topAnchor
|
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.topAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -153,6 +217,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the topAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinTopLessThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinTopLessThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.topAnchor
|
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.topAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -160,6 +228,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a topAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the topAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinTopGreaterThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinTopGreaterThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.topAnchor
|
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.topAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -173,29 +245,48 @@ extension UIView {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
extension UIView {
|
extension UIView {
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinBottom(_ constant: CGFloat = 0.0) -> Self {
|
public func pinBottom(_ constant: CGFloat = 0.0) -> Self {
|
||||||
return pinBottom(nil, constant)
|
return pinBottom(nil, constant)
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor to a specific YAxisAnchor.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the bottomAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinBottom(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinBottom(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinBottom(anchor: anchor, constant: constant)
|
pinBottom(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor to a specific YAxisAnchor passed in using a lessThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the bottomAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinBottomLessThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinBottomLessThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinBottomLessThanOrEqualTo(anchor: anchor, constant: constant)
|
pinBottomLessThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor to a specific YAxisAnchor passed in using a greaterThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the bottomAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinBottomGreaterThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinBottomGreaterThanOrEqualTo(_ anchor: NSLayoutYAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinBottomGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
pinBottomGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor for the constant passed into the method.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the bottomAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinBottom(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinBottom(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.bottomAnchor
|
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.bottomAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -203,6 +294,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the bottomAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinBottomLessThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinBottomLessThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.bottomAnchor
|
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.bottomAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -210,6 +305,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a bottomAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the bottomAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinBottomGreaterThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinBottomGreaterThanOrEqualTo(anchor: NSLayoutYAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.bottomAnchor
|
let found: NSLayoutYAxisAnchor? = anchor ?? superview?.bottomAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -223,29 +322,48 @@ extension UIView {
|
|||||||
extension UIView {
|
extension UIView {
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinLeading(_ constant: CGFloat = 0.0) -> Self {
|
public func pinLeading(_ constant: CGFloat = 0.0) -> Self {
|
||||||
return pinLeading(nil, constant)
|
return pinLeading(nil, constant)
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor to a specific XAxisAnchor.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the leadingAnchor.
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinLeading(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinLeading(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinLeading(anchor: anchor, constant: constant)
|
pinLeading(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor to a specific XAxisAnchor passed in using a greaterThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the leadingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinLeadingLessThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinLeadingLessThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinLeadingLessThanOrEqualTo(anchor: anchor, constant: constant)
|
pinLeadingLessThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor to a specific XAxisAnchor passed in using a greaterThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the leadingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinLeadingGreaterThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinLeadingGreaterThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinLeadingGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
pinLeadingGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor for the constant passed into the method.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the leadingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinLeading(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinLeading(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.leadingAnchor
|
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.leadingAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -253,6 +371,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the leadingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinLeadingLessThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinLeadingLessThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.leadingAnchor
|
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.leadingAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -260,6 +382,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a leadingAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the leadingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinLeadingGreaterThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinLeadingGreaterThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.leadingAnchor
|
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.leadingAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -273,29 +399,48 @@ extension UIView {
|
|||||||
extension UIView {
|
extension UIView {
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor.
|
||||||
|
/// - Parameter constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTrailing(_ constant: CGFloat = 0.0) -> Self {
|
public func pinTrailing(_ constant: CGFloat = 0.0) -> Self {
|
||||||
pinTrailing(nil, constant)
|
pinTrailing(nil, constant)
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor to a specific XAxisAnchor.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the trailingAnchor.
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTrailing(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinTrailing(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinTrailing(anchor: anchor, constant: constant)
|
pinTrailing(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor to a specific XAxisAnchor passed in using a lessThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the trailingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTrailingLessThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinTrailingLessThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinTrailingLessThanOrEqualTo(anchor: anchor, constant: constant)
|
pinTrailingLessThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor to a specific XAxisAnchor passed in using a greaterThanOrEqualTo Constraint
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the trailingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: Yourself.
|
||||||
public func pinTrailingGreaterThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
public func pinTrailingGreaterThanOrEqualTo(_ anchor: NSLayoutXAxisAnchor? = nil, _ constant: CGFloat = 0.0) -> Self {
|
||||||
pinTrailingGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
pinTrailingGreaterThanOrEqualTo(anchor: anchor, constant: constant)
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor for the constant passed into the method.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the trailingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinTrailing(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinTrailing(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.trailingAnchor
|
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.trailingAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -303,6 +448,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the trailingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinTrailingLessThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinTrailingLessThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.trailingAnchor
|
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.trailingAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -310,6 +459,10 @@ extension UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Adds a trailingAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||||
|
/// - Parameter anchor:The anchor in which to attach the trailingAnchor
|
||||||
|
/// - constant: Constant size.
|
||||||
|
/// - Returns: The Constraint that was created.
|
||||||
public func pinTrailingGreaterThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
public func pinTrailingGreaterThanOrEqualTo(anchor: NSLayoutXAxisAnchor?, constant: CGFloat = 0.0) -> NSLayoutConstraint? {
|
||||||
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.trailingAnchor
|
let found: NSLayoutXAxisAnchor? = anchor ?? superview?.trailingAnchor
|
||||||
guard let found else { return nil }
|
guard let found else { return nil }
|
||||||
@ -320,17 +473,22 @@ extension UIView {
|
|||||||
extension NSLayoutConstraint {
|
extension NSLayoutConstraint {
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Activates yourself
|
||||||
|
/// - Returns: Self
|
||||||
public func activate() -> Self{
|
public func activate() -> Self{
|
||||||
isActive = true
|
isActive = true
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
/// Deactivates yourself
|
||||||
|
/// - Returns: Self
|
||||||
public func deactivate() -> Self{
|
public func deactivate() -> Self{
|
||||||
isActive = false
|
isActive = false
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Helper class that holds onto all types of Contraints.
|
||||||
public class Container {
|
public class Container {
|
||||||
public var topConstraint: NSLayoutConstraint?
|
public var topConstraint: NSLayoutConstraint?
|
||||||
public var leadingConstraint: NSLayoutConstraint?
|
public var leadingConstraint: NSLayoutConstraint?
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
/// Enum that is matched up for the Verizon fonts.
|
||||||
public enum Font: String, FontProtocol {
|
public enum Font: String, FontProtocol {
|
||||||
case dsBold
|
case dsBold
|
||||||
case dsRegular
|
case dsRegular
|
||||||
@ -29,6 +30,7 @@ public enum Font: String, FontProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// File Extension for each of the Font enums.
|
||||||
public var fontFileExtension: String {
|
public var fontFileExtension: String {
|
||||||
return "otf"
|
return "otf"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,12 +8,15 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
|
/// Used in Classes that require Fonts
|
||||||
public protocol FontProtocol: CaseIterable, RawRepresentable, Hashable {
|
public protocol FontProtocol: CaseIterable, RawRepresentable, Hashable {
|
||||||
var fontFileExtension: String { get }
|
var fontFileExtension: String { get }
|
||||||
var fontName: String { get }
|
var fontName: String { get }
|
||||||
}
|
}
|
||||||
|
|
||||||
extension FontProtocol {
|
extension FontProtocol {
|
||||||
|
|
||||||
|
/// Registers the fonts used in the VDS Framework.
|
||||||
public func register() {
|
public func register() {
|
||||||
guard let bundle = Bundle(identifier: "com.vzw.vds") else { return }
|
guard let bundle = Bundle(identifier: "com.vzw.vds") else { return }
|
||||||
Self.allCases.forEach{ font in
|
Self.allCases.forEach{ font in
|
||||||
@ -29,6 +32,8 @@ extension FontProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Registers a font from a fileLocation
|
||||||
|
/// - Parameter url: URL of the file location.
|
||||||
public static func register(from url: URL) throws {
|
public static func register(from url: URL) throws {
|
||||||
guard let fontDataProvider = CGDataProvider(url: url as CFURL) else {
|
guard let fontDataProvider = CGDataProvider(url: url as CFURL) else {
|
||||||
throw NSError(domain: "www.verizon.com", code: 123, userInfo: ["description":"Could not create font data provider for \(url)."])
|
throw NSError(domain: "www.verizon.com", code: 123, userInfo: ["description":"Could not create font data provider for \(url)."])
|
||||||
@ -40,7 +45,11 @@ extension FontProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func font(ofSize size: CGFloat, isScaled: Bool = true) -> UIFont{
|
/// Returns a UIFont for the fontName and size given.
|
||||||
|
/// - Parameters:
|
||||||
|
/// - size: Size of the font
|
||||||
|
/// - Returns: UIFont for the fontName and Size.
|
||||||
|
public func font(ofSize size: CGFloat) -> UIFont{
|
||||||
DispatchQueue.once(block: { self.register() })
|
DispatchQueue.once(block: { self.register() })
|
||||||
guard let found = UIFont(name: self.fontName, size: size) else { return .systemFont(ofSize: size) }
|
guard let found = UIFont(name: self.fontName, size: size) else { return .systemFont(ofSize: size) }
|
||||||
return found
|
return found
|
||||||
|
|||||||
@ -14,6 +14,8 @@ public protocol Changeable: Handlerable where Self: UIControl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension Changeable {
|
extension Changeable {
|
||||||
|
/// Allows the setting of a completion block against the onChangeSubscriber cancellable. This will
|
||||||
|
/// completion block will get executed against the UIControl publisher for the 'valueChange' action.
|
||||||
public var onChange: ((Self) -> ())? {
|
public var onChange: ((Self) -> ())? {
|
||||||
get { return nil }
|
get { return nil }
|
||||||
set {
|
set {
|
||||||
|
|||||||
@ -15,6 +15,8 @@ public protocol Clickable: Handlerable where Self: UIControl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension Clickable {
|
extension Clickable {
|
||||||
|
/// Allows the setting of a completion block against the onClickSubscriber cancellable. This will
|
||||||
|
/// completion block will get executed against the UIControl publisher for the 'touchUpInside' action.
|
||||||
public var onClick: ((Self) -> ())? {
|
public var onClick: ((Self) -> ())? {
|
||||||
get { return nil }
|
get { return nil }
|
||||||
set {
|
set {
|
||||||
|
|||||||
@ -13,6 +13,8 @@ public protocol EnumSubset<T>: RawRepresentable, CaseIterable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension EnumSubset where RawValue == T.RawValue {
|
extension EnumSubset where RawValue == T.RawValue {
|
||||||
|
|
||||||
|
/// Will either return the Generic RawRepresentable object or the defaultValue
|
||||||
public var value: T {
|
public var value: T {
|
||||||
T(rawValue: rawValue) ?? defaultValue
|
T(rawValue: rawValue) ?? defaultValue
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,12 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
/// Protocol used for objects that require to show an error
|
||||||
public protocol Errorable {
|
public protocol Errorable {
|
||||||
|
|
||||||
|
/// Whether not to show the errorText
|
||||||
var showError: Bool { get set }
|
var showError: Bool { get set }
|
||||||
|
|
||||||
|
/// Text that needs to be shown if showError is true
|
||||||
var errorText: String? { get set }
|
var errorText: String? { get set }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,12 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
/// Protocol used for a FormField object
|
||||||
public protocol FormFieldable {
|
public protocol FormFieldable {
|
||||||
|
|
||||||
|
/// Unique Id for the Form Field object within a Form
|
||||||
var inputId: String? { get set }
|
var inputId: String? { get set }
|
||||||
|
|
||||||
|
/// Value for the Form Field
|
||||||
var value: AnyHashable? { get set }
|
var value: AnyHashable? { get set }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,5 +8,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public protocol Resettable {
|
public protocol Resettable {
|
||||||
|
/// Called to reset back an objects default settings.
|
||||||
func reset()
|
func reset()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
1.0.34
|
||||||
|
=======
|
||||||
|
- Added new spec for Bottom Inset for TextStyle
|
||||||
|
|
||||||
1.0.33
|
1.0.33
|
||||||
=======
|
=======
|
||||||
- Add test variable to use ratio line height or not
|
- Add test variable to use ratio line height or not
|
||||||
|
|||||||
@ -16,73 +16,86 @@ extension TextStyle {
|
|||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
|
||||||
letterSpacing: VDSTypography.letterSpacingSemiWide)
|
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -4))
|
||||||
|
|
||||||
public static let boldFeatureXLarge = TextStyle(rawValue: "boldFeatureXLarge",
|
public static let boldFeatureXLarge = TextStyle(rawValue: "boldFeatureXLarge",
|
||||||
fontFace: .dsBold,
|
fontFace: .dsBold,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
|
||||||
letterSpacing: 0)
|
letterSpacing: 0,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -4))
|
||||||
|
|
||||||
public static let featureLarge = TextStyle(rawValue: "featureLarge",
|
public static let featureLarge = TextStyle(rawValue: "featureLarge",
|
||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
|
||||||
letterSpacing: VDSTypography.letterSpacingSemiWide)
|
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -2))
|
||||||
|
|
||||||
|
|
||||||
public static let boldFeatureLarge = TextStyle(rawValue: "boldFeatureLarge",
|
public static let boldFeatureLarge = TextStyle(rawValue: "boldFeatureLarge",
|
||||||
fontFace: .dsBold,
|
fontFace: .dsBold,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
|
||||||
letterSpacing: 0)
|
letterSpacing: 0,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -2))
|
||||||
|
|
||||||
public static let featureMedium = TextStyle(rawValue: "featureMedium",
|
public static let featureMedium = TextStyle(rawValue: "featureMedium",
|
||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
|
||||||
letterSpacing: VDSTypography.letterSpacingSemiWide)
|
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -4: -2))
|
||||||
|
|
||||||
public static let boldFeatureMedium = TextStyle(rawValue: "boldFeatureMedium",
|
public static let boldFeatureMedium = TextStyle(rawValue: "boldFeatureMedium",
|
||||||
fontFace: .dsBold,
|
fontFace: .dsBold,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
|
||||||
letterSpacing: 0)
|
letterSpacing: 0,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -4: -2))
|
||||||
|
|
||||||
public static let featureSmall = TextStyle(rawValue: "featureSmall",
|
public static let featureSmall = TextStyle(rawValue: "featureSmall",
|
||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
|
||||||
letterSpacing: VDSTypography.letterSpacingSemiWide)
|
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||||
|
|
||||||
public static let boldFeatureSmall = TextStyle(rawValue: "boldFeatureSmall",
|
public static let boldFeatureSmall = TextStyle(rawValue: "boldFeatureSmall",
|
||||||
fontFace: .dsBold,
|
fontFace: .dsBold,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
|
||||||
letterSpacing: 0)
|
letterSpacing: 0,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||||
|
|
||||||
public static let featureXSmall = TextStyle(rawValue: "featureXSmall",
|
public static let featureXSmall = TextStyle(rawValue: "featureXSmall",
|
||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
|
||||||
letterSpacing: VDSTypography.letterSpacingSemiWide)
|
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||||
|
|
||||||
public static let boldFeatureXSmall = TextStyle(rawValue: "boldFeatureXSmall",
|
public static let boldFeatureXSmall = TextStyle(rawValue: "boldFeatureXSmall",
|
||||||
fontFace: .dsBold,
|
fontFace: .dsBold,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
|
||||||
letterSpacing: 0)
|
letterSpacing: 0,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||||
|
|
||||||
public static let title2XLarge = TextStyle(rawValue: "title2XLarge",
|
public static let title2XLarge = TextStyle(rawValue: "title2XLarge",
|
||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
|
||||||
letterSpacing: VDSTypography.letterSpacingSemiWide)
|
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||||
|
|
||||||
public static let boldTitle2XLarge = TextStyle(rawValue: "boldTitle2XLarge",
|
public static let boldTitle2XLarge = TextStyle(rawValue: "boldTitle2XLarge",
|
||||||
fontFace: .dsBold,
|
fontFace: .dsBold,
|
||||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
|
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
|
||||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
|
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
|
||||||
letterSpacing: 0)
|
letterSpacing: 0,
|
||||||
|
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||||
|
|
||||||
public static let titleXLarge = TextStyle(rawValue: "titleXLarge",
|
public static let titleXLarge = TextStyle(rawValue: "titleXLarge",
|
||||||
fontFace: .dsLight,
|
fontFace: .dsLight,
|
||||||
@ -214,6 +227,12 @@ extension TextStyle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension UIEdgeInsets {
|
||||||
|
public init(bottom: CGFloat) {
|
||||||
|
self.init(top: 0, left: 0, bottom: bottom, right: 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extension TextStyle {
|
extension TextStyle {
|
||||||
public enum StandardStyle: String, CaseIterable {
|
public enum StandardStyle: String, CaseIterable {
|
||||||
case featureXLarge,
|
case featureXLarge,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user