View
public protocol View
A type that represents part of your app’s user interface and provides modifiers that you use to configure views.
-
typeDefault implementationThe type of the node. Required. Default implementations provided.
Default Implementation
Declaration
Swift
var type: ArgoKitNodeType { get } -
The node behind the view. Required.
Declaration
Swift
var node: ArgoKitNode? { get } -
bodyDefault implementationThe content and behavior of the view. Required. Default implementations provided.
Default Implementation
Declaration
Swift
@ArgoKitViewBuilder var body: View { get } -
addAnimation(animation:Extension method) Add the specified animation object to this view
Declaration
Swift
@discardableResult public func addAnimation(animation: AnimationBasic) -> SelfParameters
animationThe animation to be added to this view
Return Value
self
-
addAnimation(_:Extension method) Add the specified animation object to the view
Declaration
Swift
@discardableResult public func addAnimation(@ArgoKitAnimationBuilder _ builder: () -> AnimationBasic) -> SelfParameters
builderAn animation builder that creates the animation added to this view.
Return Value
self
-
updateAnimation(serial:Extension methodprogress: ) Updates the animation in the receiver.
Declaration
Swift
@discardableResult public func updateAnimation(serial: Bool = false, progress: Float) -> SelfParameters
serialA Boolean value that controls whether the animation is serial executed. Only works when there are multiple animations.
progressThe progess of the animation. 0.0~1.0
Return Value
self
-
startAnimation(serial:Extension method) Starts the animation in the receiver.
Declaration
Swift
@discardableResult public func startAnimation(serial: Bool = false) -> SelfParameters
serialA Boolean value that controls whether the animation is serial executed. Only works when there are multiple animations.
Return Value
self
-
pauseAnimation()Extension methodPauses the animation in the receiver.
Declaration
Swift
@discardableResult public func pauseAnimation() -> SelfReturn Value
self
-
resumeAnimation()Extension methodResumes the animation in the receiver.
Declaration
Swift
@discardableResult public func resumeAnimation() -> SelfReturn Value
self
-
stopAnimation()Extension methodStops the animation in the receiver.
Declaration
Swift
@discardableResult public func stopAnimation() -> SelfReturn Value
self
-
bindCallback(_:Extension methodforKey: ) Undocumented
Declaration
Swift
@discardableResult public func bindCallback(_ callback: @escaping () -> Void, forKey key: String) -> Self -
alias(variable:Extension method) Assigns the view to the specified variable or property.
struct DemoView: View { @Alias var text: Text? var body: View { Text("Hello, ArgoKit").alias(variable: $text) } }Declaration
Swift
@discardableResult public func alias(variable: Alias<Self>?) -> SelfParameters
variableThe specified variable or property that is assigned with the view.
Return Value
self
-
alias(variable:Extension method) Assigns the view to the specified variable or property.
class DemoViewModel { var text: Text? } struct DemoView: View { var model = DemoViewModel() var body: View { Text("Hello, ArgoKit") .alias(variable: &model.text) } }Declaration
Swift
@discardableResult public func alias(variable: inout Self?) -> SelfParameters
variableThe specified variable or property that is assigned with the view.
Return Value
self
-
nodeAlias(variable:Extension method) Assigns the node to the specified variable or property.
class DemoViewModel { var nodeAlias: ArgoKitNodeAlias? } struct DemoView: View { var model = DemoViewModel() var body: View { Text("Hello, ArgoKit") .alias(variable: &model.nodeAlias) } }Declaration
Swift
@discardableResult public func nodeAlias(variable: inout ArgoKitNodeAlias?) -> SelfParameters
variableThe specified variable or property that is assigned with the node.
Return Value
self
-
nodeView()Extension methodGet view that belong to node.
Declaration
Swift
public func nodeView() -> UIView?Parameters
viewhat belong to node.
-
addSubViews(position:Extension methodbuilder: ) Adds sub views to this view hierarchy.
Declaration
Swift
@discardableResult public func addSubViews(position: ViewPosition = .default, @ArgoKitViewBuilder builder: @escaping () -> View) -> SelfParameters
builderA view builder that creates the sub views of this view.
-
removeFromSuperView()Extension methodUnlinks the view from its superview and its hostview, and removes it from the responder chain.
Declaration
Swift
@discardableResult public func removeFromSuperView() -> Self -
endEditing(_:Extension method) Causes the view (or one of its embedded text fields) to resign the first responder status.
Declaration
Swift
@discardableResult public func endEditing(_ force: Bool) -> SelfParameters
forceSpecify true to force the first responder to resign, regardless of whether it wants to do so.
Return Value
self
-
gesture(_:Extension methodenabled: ) Adds the gesture to this View
Declaration
Swift
@discardableResult public func gesture(_ gesture: @autoclosure @escaping () -> Gesture, enabled: @autoclosure @escaping () -> Bool = true) -> SelfParameters
gestureThe gesture that is added to this view.
enabledThe gesture is enabled.
Return Value
Self
-
removeGesture(gesture:Extension method) Removes the gesture from this view.
Declaration
Swift
@discardableResult public func removeGesture(gesture: Gesture) -> SelfParameters
gestureThe gesture that is removed from this view.
Return Value
Self
-
onTapGesture(numberOfTaps:Extension methodnumberOfTouches: enabled: action: ) Adds tap gesture to this View
Declaration
Swift
@discardableResult public func onTapGesture(numberOfTaps: Int = 1, numberOfTouches: Int = 1, enabled: @autoclosure @escaping () -> Bool = true, action: @escaping () -> Void) -> SelfParameters
numberOfTapsThe number of taps necessary for gesture recognition.
numberOfTouchesThe number of fingers that the user must tap for gesture recognition.
enabledThe gesture is enabled,default is true
actionThe action to handle the gesture recognized by the receiver.
Return Value
Self
-
onLongPressGesture(numberOfTaps:Extension methodnumberOfTouches: minimumPressDuration: allowableMovement: enabled: action: ) Adds long press gesture to this View
Declaration
Swift
@discardableResult public func onLongPressGesture(numberOfTaps: Int = 0, numberOfTouches: Int = 1, minimumPressDuration: TimeInterval = 0.5, allowableMovement: CGFloat = 10, enabled: @autoclosure @escaping () -> Bool = true, action: @escaping () -> Void) -> SelfParameters
numberOfTapsThe number of taps on the view necessary for gesture recognition.
numberOfTouchesThe number of fingers that must touch the view for gesture recognition.
minimumPressDurationThe minimum time that the user must press on the view for the gesture to be recognized.
allowableMovementThe maximum movement of the fingers on the view before the gesture fails.
enabledThe gesture is enabled,default is true
actionThe action to handle the gesture recognized by the receiver.
Return Value
Self
-
direction(_:Extension method) Layout direction specifies the direction in which children and text in a hierarchy should be laid out. Layout direction also effects what edge start and end refer to. By default Yoga lays out with LTR layout direction. In this mode start refers to left and end refers to right. When localizing your apps for markets with RTL languages you should customize this by either by passing a direction to the CalculateLayout call or by setting the direction on the root node.
Declaration
Swift
@discardableResult public func direction(_ value: ArgoDirection) -> SelfParameters
valueThe type of flex direction.
Return Value
self
-
flexDirection(_:Extension method) Flex direction controls the direction in which children of a node are laid out. This is also referred to as the main axis. The main axis is the direction in which children are laid out. The cross axis the the axis perpendicular to the main axis, or the axis which wrapping lines are laid out in.
Declaration
Swift
@discardableResult public func flexDirection(_ value: @autoclosure @escaping () -> ArgoFlexDirection) -> SelfParameters
valueThe type of flex direction.
Return Value
self
-
justifyContent(_:Extension method) Ustify content describes how to align children within the main axis of their container. For example, you can use this property to center a child horizontally within a container with flex direction set to row or vertically within a container with flex direction set to column.
Declaration
Swift
@discardableResult public func justifyContent(_ value: @autoclosure @escaping () -> ArgoJustify) -> SelfParameters
valueThe type of justify content.
Return Value
self
-
alignContent(_:Extension method) Align content defines the distribution of lines along the cross-axis. This only has effect when items are wrapped to multiple lines using flex wrap.
Declaration
Swift
@discardableResult public func alignContent(_ value: @autoclosure @escaping () -> ArgoAlign) -> SelfParameters
valueThe type of align content.
Return Value
self
-
alignItems(_:Extension method) Align items describes how to align children along the cross axis of their container. Align items is very similar to justify content but instead of applying to the main axis, align items applies to the cross axis.
Declaration
Swift
@discardableResult public func alignItems(_ value: @autoclosure @escaping () -> ArgoAlign) -> SelfParameters
valueThe type of align items.
Return Value
self
-
alignSelf(_:Extension method) Align self has the same options and effect as align items but instead of affecting the children within a container, you can apply this property to a single child to change its alignment within its parent. align self overrides any option set by the parent with align items.
Declaration
Swift
@discardableResult public func alignSelf(_ value: @autoclosure @escaping () -> ArgoAlign) -> SelfParameters
valueThe type of align self.
Return Value
self
-
wrap(_:Extension method) The flex wrap property is set on containers and controls what happens when children overflow the size of the container along the main axis. By default children are forced into a single line (which can shrink elements). If wrapping is allowed items are wrapped into multiple lines along the main axis if needed. wrap reverse behaves the same, but the order of the lines is reversed.
Declaration
Swift
@discardableResult public func wrap(_ value: @autoclosure @escaping () -> ArgoWrapType) -> SelfParameters
valueThe type of flex wrap.
Return Value
self
-
flex(_:Extension method) Sets how a flex item will grow or shrink to fit the space available in its flex container.
Declaration
Swift
@discardableResult public func flex(_ value: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe value of flex.
Return Value
self
-
grow(_:Extension method) Sets the flex grow factor of a flex item’s main size. This property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor).
Declaration
Swift
@discardableResult public func grow(_ value: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe value of grow.
Return Value
self
-
shrink(_:Extension method) Sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to flex-shrink.
Declaration
Swift
@discardableResult public func shrink(_ value: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe value of shrink.
Return Value
self
-
basis(_:Extension method) Sets the initial main size of a flex item.
Declaration
Swift
@discardableResult public func basis(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe type of basis.
Return Value
self
-
positionType(_:Extension method) The position type of this view defines how it is positioned within its parent.
Declaration
Swift
@discardableResult public func positionType(_ value: @autoclosure @escaping () -> ArgoPositionType) -> SelfParameters
valueThe type of position.
Return Value
self
-
position(top:Extension methodright: bottom: left: ) Sets how this view is positioned in a view.
Declaration
Swift
@discardableResult public func position(top: @autoclosure @escaping () -> ArgoValue, right: @autoclosure @escaping () -> ArgoValue, bottom: @autoclosure @escaping () -> ArgoValue, left: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
topThe top style attribute defines the offset between the upper margin boundary of the positioned element and the upper boundary of its containing block.
rightThe right style attribute defines the offset between the right margin boundary of the positioned element and the right boundary of the containing block.
bottomThe bottom style attribute defines the offset between the bottom margin boundary of the positioning element and the bottom boundary of its containing block.
leftThe left style attribute defines the offset between the left margin boundary of the positioned element and the left boundary of its containing block.
Return Value
self
-
position(edge:Extension methodvalue: ) Sets how this view is positioned in a view.
Declaration
Swift
@discardableResult public func position(edge: @autoclosure @escaping () -> ArgoEdge, value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
edgeThe type of Edge. left, top, right, bottom, start, end, all are valid.
valueThe value offset.
Return Value
self
-
margin(top:Extension methodright: bottom: left: ) Sets the margin area on all four sides of this view.
Declaration
Swift
@discardableResult public func margin(top: @autoclosure @escaping () -> ArgoValue, right: @autoclosure @escaping () -> ArgoValue, bottom: @autoclosure @escaping () -> ArgoValue, left: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
topThe margin area on the top of this view
rightThe margin area on the right side of this view.
bottomThe margin area on the bottom of this view.
leftThe margin area on the left side of this view.
Return Value
self
-
margin(edge:Extension methodvalue: ) Sets the margin area on specified side of this view.
Declaration
Swift
@discardableResult public func margin(edge: @autoclosure @escaping () -> ArgoEdge, value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
edgeThe type of edge.
valueThe margin area on the edge of this view.
Return Value
self
-
padding(top:Extension methodright: bottom: left: ) Sets the padding area on all four sides of this view at once.
Declaration
Swift
@discardableResult public func padding(top: @autoclosure @escaping () -> ArgoValue, right: @autoclosure @escaping () -> ArgoValue, bottom: @autoclosure @escaping () -> ArgoValue, left: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
topThe height of the padding area on the top of this view.
rightThe width of the padding area on the right of this view.
bottomThe height of the padding area on the bottom of this view.
leftThe width of the padding area to the left of this view.
Return Value
self
-
padding(edge:Extension methodvalue: ) Sets the padding area on specified side of this view.
Declaration
Swift
@discardableResult public func padding(edge: @autoclosure @escaping () -> ArgoEdge, value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
edgeThe type of edge.
valueThe padding area on the edge of this view.
Return Value
self
-
width(_:Extension method) Sets the width of this view.
Declaration
Swift
@discardableResult public func width(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe width of this view.
Return Value
self
-
height(_:Extension method) Sets the height of this view.
Declaration
Swift
@discardableResult public func height(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe height of this view.
Return Value
self
-
minWidth(_:Extension method) Sets the minimum width of this view.
Declaration
Swift
@discardableResult public func minWidth(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe minimum width of this view.
Return Value
self
-
minHeight(_:Extension method) Sets the minimum height of this view.
Declaration
Swift
@discardableResult public func minHeight(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe minimum height of this view.
Return Value
self
-
maxWidth(_:Extension method) Sets the maximal width of this view.
Declaration
Swift
@discardableResult public func maxWidth(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe maximal width of this view.
Return Value
self
-
maxHeight(_:Extension method) Sets the maximal height of this view.
Declaration
Swift
@discardableResult public func maxHeight(_ value: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
valueThe maximal height of this view.
Return Value
self
-
size(width:Extension methodheight: ) Sets the size of this view.
Declaration
Swift
@discardableResult public func size(width: @autoclosure @escaping () -> ArgoValue, height: @autoclosure @escaping () -> ArgoValue) -> SelfParameters
widthThe width of this view.
heightThe height of this view.
Return Value
self
-
aspect(ratio:Extension method) Sets the aspect ratio of this view.
Declaration
Swift
@discardableResult public func aspect(ratio: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe aspect ratio of this view.
Return Value
self
-
parentNode()Extension methodGets the parent node of this view.
Declaration
Swift
public func parentNode() -> ArgoKitNode?Return Value
The parent node of this view.
-
applyLayout()Extension methodPerform a layout calculation and update the frames of the views in the hierarchy with the results. If the origin is not preserved, the root view’s layout results will applied from {0,0}.
Declaration
Swift
@discardableResult public func applyLayout() -> CGSizeReturn Value
The size of the view based on provided constraints.
-
applyLayout(size:Extension method) Perform a layout calculation and update the frames of the views in the hierarchy with the results. Pass NaN for an unconstrained dimension.
Declaration
Swift
@discardableResult public func applyLayout(size: CGSize) -> CGSizeParameters
sizeThe size for which the view should calculate its best-fitting size.
Return Value
The size of the view based on provided constraints.
-
calculateLayout(size:Extension method) Perform a layout calculation but do not update the frames of the views in the hierarchy with the results. Pass NaN for an unconstrained dimension.
Declaration
Swift
@discardableResult public func calculateLayout(size: CGSize) -> CGSizeParameters
sizeThe size for which the view should calculate its best-fitting size.
Return Value
The size of the view based on provided constraints.
-
displayFlex()Extension methodUndocumented
Declaration
Swift
public func displayFlex() -> Self -
displayNone()Extension methodUndocumented
Declaration
Swift
public func displayNone() -> Self -
width()Extension methodGets the width of this view.
Declaration
Swift
public func width() -> CGFloatReturn Value
The width of this view.
-
height()Extension methodGets the height of this view.
Declaration
Swift
public func height() -> CGFloatReturn Value
The height of this view.
-
minWidth()Extension methodGets the minimum width of this view.
Declaration
Swift
public func minWidth() -> CGFloatReturn Value
The minimum width of this view.
-
minHeight()Extension methodGets the minimum height of this view.
Declaration
Swift
public func minHeight() -> CGFloatReturn Value
The minimum height of this view.
-
maxWidth()Extension methodGets the maximal width of this view.
Declaration
Swift
public func maxWidth() -> CGFloatReturn Value
The maximal width of this view.
-
maxHeight()Extension methodGets the maximal height of this view.
Declaration
Swift
public func maxHeight() -> CGFloatReturn Value
The maximal height of this view.
-
userInteractionEnabled(_:Extension method) Sets a Boolean value that determines whether user events are ignored and removed from the event queue.
Declaration
Swift
@discardableResult public func userInteractionEnabled(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valueA Boolean value that determines whether user events are ignored and removed from the event queue.
Return Value
Self
-
backgroundColor(_:Extension method) Sets the view’s background color.
Declaration
Swift
@discardableResult public func backgroundColor(_ value: @autoclosure @escaping () -> UIColor) -> SelfParameters
valueThe view’s background color.
Return Value
Self
-
backgroundColor(red:Extension methodgreen: blue: alpha: ) Sets the view’s background color.
Declaration
Swift
@discardableResult public func backgroundColor(red r: @autoclosure @escaping () -> Int, green g: @autoclosure @escaping () -> Int, blue b: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> CGFloat = 1) -> SelfParameters
rThe red value of the color object. 0~255
gThe green value of the color object. 0~255
bThe blue value of the color object. 0~255
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
backgroundColor(hex:Extension methodalpha: ) Sets the view’s background color.
Declaration
Swift
@discardableResult public func backgroundColor(hex: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> Float = 1) -> SelfParameters
hexThe hex value of the color object
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
alpha(_:Extension method) Sets the view’s alpha value.
Declaration
Swift
@discardableResult public func alpha(_ value: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe view’s alpha value, specified as a value from 0.0 to 1.0.
Return Value
Self
-
opaque(_:Extension method) Gets a Boolean value that determines whether the view is opaque.
Declaration
Swift
@discardableResult public func opaque(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valueA Boolean value that determines whether the view is opaque.
Return Value
Self
-
clearsContextBeforeDrawing(_:Extension method) Sets a Boolean value that determines whether the view’s bounds should be automatically cleared before drawing.
Declaration
Swift
@discardableResult public func clearsContextBeforeDrawing(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valueA Boolean value that determines whether the view’s bounds should be automatically cleared before drawing.
Return Value
Self
-
hidden(_:Extension method) Sets a Boolean value that determines whether the view is hidden.
Declaration
Swift
@discardableResult public func hidden(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valueA Boolean value that determines whether the view is hidden.
Return Value
Self
-
gone(_:Extension method) Sets a Boolean value that determines whether the view is hidden and styling properties should be applied
Declaration
Swift
@discardableResult public func gone(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valuetrue if you want to hide the view and not applied styling properties.
Return Value
Self
-
contentMode(_:Extension method) Sets options to specify how a view adjusts its content when its size changes.
Declaration
Swift
@discardableResult public func contentMode(_ value: @autoclosure @escaping () -> UIView.ContentMode) -> SelfParameters
valueOptions to specify how a view adjusts its content when its size changes.
Return Value
Self
-
tintColor(_:Extension method) Sets the first nondefault tint color value in the view’s hierarchy, ascending from and starting with the view itself.
Declaration
Swift
@discardableResult public func tintColor(_ value: @autoclosure @escaping () -> UIColor) -> SelfParameters
valueThe first nondefault tint color value in the view’s hierarchy, ascending from and starting with the view itself.
Return Value
Self
-
tintColor(red:Extension methodgreen: blue: alpha: ) Sets the first nondefault tint color value in the view’s hierarchy, ascending from and starting with the view itself.
Declaration
Swift
@discardableResult public func tintColor(red r: @autoclosure @escaping () -> Int, green g: @autoclosure @escaping () -> Int, blue b: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> CGFloat = 1) -> SelfParameters
rThe red value of the color object. 0~255
gThe green value of the color object. 0~255
bThe blue value of the color object. 0~255
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
tintColor(hex:Extension methodalpha: ) Sets the first nondefault tint color value in the view’s hierarchy, ascending from and starting with the view itself.
Declaration
Swift
@discardableResult public func tintColor(hex: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> Float = 1) -> SelfParameters
hexThe hex value of the color object
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
tintAdjustmentMode(_:Extension method) Sets the first non-default tint adjustment mode value in the view’s hierarchy, ascending from and starting with the view itself.
Declaration
Swift
@discardableResult public func tintAdjustmentMode(_ value: @autoclosure @escaping () -> UIView.TintAdjustmentMode) -> SelfParameters
valueThe first non-default tint adjustment mode value in the view’s hierarchy, ascending from and starting with the view itself.
Return Value
Self
-
clipsToBounds(_:Extension method) Sets a Boolean value that determines whether subviews are confined to the bounds of the view.
Declaration
Swift
@discardableResult public func clipsToBounds(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valueA Boolean value that determines whether subviews are confined to the bounds of the view.
Return Value
Self
-
cornerRadius(_:Extension method) Sets the corner radius of this view.
Declaration
Swift
@discardableResult public func cornerRadius(_ value: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe corner radius of this view.
Return Value
Self
-
cornerRadius(topLeft:Extension methodtopRight: bottomLeft: bottomRight: ) Sets the radius of this view’s corner.
Declaration
Swift
@discardableResult public func cornerRadius(topLeft: @autoclosure @escaping () -> CGFloat, topRight: @autoclosure @escaping () -> CGFloat, bottomLeft: @autoclosure @escaping () -> CGFloat, bottomRight: @autoclosure @escaping () -> CGFloat) -> SelfParameters
topLeftThe radius of this view’s top left corner.
topRightThe radius of this view’s top right corner.
bottomLeftThe radius of this view’s bottom left corner.
bottomRightThe radius of this view’s bottom right corner.
Return Value
Self
-
borderWidth(_:Extension method) Sets the width of this view’s border.
Declaration
Swift
@discardableResult public func borderWidth(_ value: @autoclosure @escaping () -> CGFloat) -> SelfParameters
valueThe border width of this view.
Return Value
Self
-
borderColor(_:Extension method) Sets the color of this view’s border.
Declaration
Swift
@discardableResult public func borderColor(_ value: @autoclosure @escaping () -> UIColor) -> SelfParameters
valueThe border color of this view.
Return Value
Self
-
borderColor(red:Extension methodgreen: blue: alpha: ) Sets the color of this view’s border.
Declaration
Swift
@discardableResult public func borderColor(red r: @autoclosure @escaping () -> Int, green g: @autoclosure @escaping () -> Int, blue b: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> CGFloat = 1) -> SelfParameters
rThe red value of the color object. 0~255
gThe green value of the color object. 0~255
bThe blue value of the color object. 0~255
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
borderColor(hex:Extension methodalpha: ) Sets the color of this view’s border.
Declaration
Swift
@discardableResult public func borderColor(hex: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> Float = 1) -> SelfParameters
hexThe hex value of the color object
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
shadowColor(_:Extension method) Sets the color of the layer’s shadow. Animatable.
Declaration
Swift
@discardableResult public func shadowColor(_ value: @autoclosure @escaping () -> UIColor?) -> SelfParameters
valueThe color of the layer’s shadow.
Return Value
Self
-
shadowColor(red:Extension methodgreen: blue: alpha: ) Sets the color of the layer’s shadow. Animatable.
Declaration
Swift
@discardableResult public func shadowColor(red r: @autoclosure @escaping () -> Int, green g: @autoclosure @escaping () -> Int, blue b: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> CGFloat = 1) -> SelfParameters
rThe red value of the color object. 0~255
gThe green value of the color object. 0~255
bThe blue value of the color object. 0~255
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
shadowColor(hex:Extension methodalpha: ) Sets the color of the layer’s shadow. Animatable.
Declaration
Swift
@discardableResult public func shadowColor(hex: @autoclosure @escaping () -> Int, alpha a: @autoclosure @escaping () -> Float = 1) -> SelfParameters
hexThe hex value of the color object
aThe opacity value of the color object, specified as a value from 0.0 to 1.0.
Return Value
Self
-
shadow(offset:Extension methodradius: opacity: ) Sets the the offset, radius and opacity of the layer’s shadow. Animatable.
Declaration
Swift
@discardableResult public func shadow(offset: @autoclosure @escaping () -> CGSize, radius: @autoclosure @escaping () -> CGFloat, opacity: @autoclosure @escaping () -> Float) -> SelfParameters
offsetThe offset of the layer’s shadow.
radiusThe radius of the layer’s shadow.
opacityThe opacity of the layer’s shadow.
Return Value
Self
-
shadow(color:Extension methodoffset: radius: opacity: corners: ) Config the layer’s shadow. Animatable.
Declaration
Swift
@discardableResult public func shadow(color: @autoclosure @escaping () -> UIColor? = .gray, offset: @autoclosure @escaping () -> CGSize, radius: @autoclosure @escaping () -> CGFloat, opacity: @autoclosure @escaping () -> Float, corners: @autoclosure @escaping () -> UIRectCorner = .allCorners) -> SelfParameters
colorThe color of the layer’s shadow.
offsetThe offset of the layer’s shadow.
radiusThe radius of the layer’s shadow.
opacityThe opacity of the layer’s shadow.
cornersThe radius of this view’s corner.
Return Value
Self
-
gradientColor(startColor:Extension methodendColor: direction: ) Sets the view’s background gradient color.
Declaration
Swift
@discardableResult public func gradientColor(startColor: @autoclosure @escaping () -> UIColor?, endColor: @autoclosure @escaping () -> UIColor?, direction: @autoclosure @escaping () -> ArgoKitGradientType?) -> SelfParameters
startColorThe start color of the gradient.
endColorThe end color of the gradient.
directionThe direction of the gradient.
Return Value
Self
-
hidKeyBoard(_:Extension method) hid key board
Declaration
Swift
@discardableResult public func hidKeyBoard(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valueresignFirstResponder when the value is true
Return Value
Self
-
showKeyBoard(_:Extension method) show key board
Declaration
Swift
@discardableResult public func showKeyBoard(_ value: @autoclosure @escaping () -> Bool) -> SelfParameters
valuebecomeFirstResponder when the value is true
Return Value
Self
-
addAttribute(isCALayer:Extension methodisDirty: _: _: ) Adds attribute to the UIKit View
Declaration
Swift
public func addAttribute(isCALayer: Bool = false, isDirty: Bool = false, _ selector: Selector, _ patamter: Any?...)Parameters
isCALayertrue if is calayer.
isDirtytrue if the attribute may change the view layout
selectorThe selector of the attribute.
patamterpatamter.
-
preformAttribute(isCALayer:Extension methodisDirty: _: _: ) Preform attribute to the UIKit View
Declaration
Swift
public func preformAttribute(isCALayer: Bool = false, isDirty: Bool = false, _ selector: Selector, _ patamter: Any?...)Parameters
isCALayertrue if is calayer.
isDirtytrue if the attribute may change the view layout
selectorThe selector of the attribute.
patamterpatamter.
-
tag(_:Extension method) Sets an integer that you can use to identify view objects in your application.
Declaration
Swift
@discardableResult public func tag(_ value: Int) -> SelfParameters
valueAn integer that you can use to identify view objects in your application.
Return Value
Self
-
tag()Extension methodGets an integer that you can use to identify view objects in your application.
Declaration
Swift
public func tag() -> Int?Return Value
An integer that you can use to identify view objects in your application.
-
layer()Extension methodGets the view’s Core Animation layer used for rendering.
Declaration
Swift
public func layer() -> CALayer?Return Value
The view’s Core Animation layer used for rendering.
-
canBecomeFocused()Extension methodGets a Boolean value that indicates whether the view is currently capable of being focused.
Declaration
Swift
@available(iOS 9.0, *) public func canBecomeFocused() -> Bool?Return Value
A Boolean value that indicates whether the view is currently capable of being focused.
-
isFocused()Extension methodGets a Boolean value that indicates whether the item is currently focused.
Declaration
Swift
@available(iOS 9.0, *) public func isFocused() -> Bool?Return Value
A Boolean value that indicates whether the item is currently focused.
-
focusGroupIdentifier(_:Extension method) Sets the identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview’s focus group.
Declaration
Swift
@available(iOS 14.0, *) @discardableResult public func focusGroupIdentifier(_ value: String?) -> SelfParameters
valueThe identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview’s focus group.
Return Value
Self
-
focusGroupIdentifier()Extension methodGets the identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview’s focus group.
Declaration
Swift
@available(iOS 14.0, *) @discardableResult public func focusGroupIdentifier() -> String?Return Value
The identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview’s focus group.
-
semanticContentAttribute(_:Extension method) Sets a semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts.
Declaration
Swift
@available(iOS 9.0, *) @discardableResult public func semanticContentAttribute(_ value: UISemanticContentAttribute) -> SelfParameters
valueA semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts.
Return Value
Self
-
semanticContentAttribute()Extension methodGets a semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts.
Declaration
Swift
public func semanticContentAttribute() -> UISemanticContentAttribute?Return Value
A semantic description of the view’s contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts.
-
effectiveUserInterfaceLayoutDirection()Extension methodGets the user interface layout direction appropriate for arranging the immediate content of the view.
Declaration
Swift
@available(iOS 10.0, *) public func effectiveUserInterfaceLayoutDirection() -> UIUserInterfaceLayoutDirection?Return Value
The user interface layout direction appropriate for arranging the immediate content of the view.
-
circle()Extension methodClip this view to circle.
Declaration
Swift
@discardableResult public func circle() -> SelfReturn Value
Self
-
cleanGradientLayer()Extension methodClean the view’s background gradient color.
Declaration
Swift
@discardableResult public func cleanGradientLayer() -> SelfReturn Value
Self
-
addBlurEffect(style:Extension methodalpha: color: ) Adds blur effect to this view.
Declaration
Swift
@discardableResult public func addBlurEffect(style: UIBlurEffect.Style, alpha: CGFloat? = nil, color: UIColor? = nil) -> SelfParameters
styleThe intensity of the blur effect. See UIBlurEffect.Style for valid options.
alphaThe alpha of the blur effect.
colorThe color of the blur effect.
Return Value
Self
-
removeBlurEffect()Extension methodRemoves blur effect.
Declaration
Swift
@discardableResult public func removeBlurEffect() -> SelfReturn Value
Self
-
alert(_:Extension method) Add alert View
Declaration
Swift
@discardableResult public func alert(_ content: () -> AlertView) -> SelfParameters
contentthe builder of alert View
Return Value
self
-
progressViewStyle(style:Extension method) Undocumented
Declaration
Swift
public func progressViewStyle<S>(style: S) -> View where S : ProgressViewStyle
View Protocol Reference