View
public protocol View
A type that represents part of your app’s user interface and provides modifiers that you use to configure views.
-
type
Default 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 }
-
body
Default 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) -> Self
Parameters
animation
The 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) -> Self
Parameters
builder
An 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) -> Self
Parameters
serial
A Boolean value that controls whether the animation is serial executed. Only works when there are multiple animations.
progress
The 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) -> Self
Parameters
serial
A 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() -> Self
Return Value
self
-
resumeAnimation()
Extension methodResumes the animation in the receiver.
Declaration
Swift
@discardableResult public func resumeAnimation() -> Self
Return Value
self
-
stopAnimation()
Extension methodStops the animation in the receiver.
Declaration
Swift
@discardableResult public func stopAnimation() -> Self
Return 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>?) -> Self
Parameters
variable
The 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?) -> Self
Parameters
variable
The 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?) -> Self
Parameters
variable
The 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
view
hat 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) -> Self
Parameters
builder
A 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) -> Self
Parameters
force
Specify 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) -> Self
Parameters
gesture
The gesture that is added to this view.
enabled
The gesture is enabled.
Return Value
Self
-
removeGesture(gesture:
Extension method) Removes the gesture from this view.
Declaration
Swift
@discardableResult public func removeGesture(gesture: Gesture) -> Self
Parameters
gesture
The 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) -> Self
Parameters
numberOfTaps
The number of taps necessary for gesture recognition.
numberOfTouches
The number of fingers that the user must tap for gesture recognition.
enabled
The gesture is enabled,default is true
action
The 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) -> Self
Parameters
numberOfTaps
The number of taps on the view necessary for gesture recognition.
numberOfTouches
The number of fingers that must touch the view for gesture recognition.
minimumPressDuration
The minimum time that the user must press on the view for the gesture to be recognized.
allowableMovement
The maximum movement of the fingers on the view before the gesture fails.
enabled
The gesture is enabled,default is true
action
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
top
The top style attribute defines the offset between the upper margin boundary of the positioned element and the upper boundary of its containing block.
right
The right style attribute defines the offset between the right margin boundary of the positioned element and the right boundary of the containing block.
bottom
The bottom style attribute defines the offset between the bottom margin boundary of the positioning element and the bottom boundary of its containing block.
left
The 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) -> Self
Parameters
edge
The type of Edge. left, top, right, bottom, start, end, all are valid.
value
The 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) -> Self
Parameters
top
The margin area on the top of this view
right
The margin area on the right side of this view.
bottom
The margin area on the bottom of this view.
left
The 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) -> Self
Parameters
edge
The type of edge.
value
The 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) -> Self
Parameters
top
The height of the padding area on the top of this view.
right
The width of the padding area on the right of this view.
bottom
The height of the padding area on the bottom of this view.
left
The 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) -> Self
Parameters
edge
The type of edge.
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
width
The width of this view.
height
The 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) -> Self
Parameters
value
The 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() -> CGSize
Return 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) -> CGSize
Parameters
size
The 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) -> CGSize
Parameters
size
The 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() -> CGFloat
Return Value
The width of this view.
-
height()
Extension methodGets the height of this view.
Declaration
Swift
public func height() -> CGFloat
Return Value
The height of this view.
-
minWidth()
Extension methodGets the minimum width of this view.
Declaration
Swift
public func minWidth() -> CGFloat
Return Value
The minimum width of this view.
-
minHeight()
Extension methodGets the minimum height of this view.
Declaration
Swift
public func minHeight() -> CGFloat
Return Value
The minimum height of this view.
-
maxWidth()
Extension methodGets the maximal width of this view.
Declaration
Swift
public func maxWidth() -> CGFloat
Return Value
The maximal width of this view.
-
maxHeight()
Extension methodGets the maximal height of this view.
Declaration
Swift
public func maxHeight() -> CGFloat
Return 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) -> Self
Parameters
value
A 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) -> Self
Parameters
value
The 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) -> Self
Parameters
r
The red value of the color object. 0~255
g
The green value of the color object. 0~255
b
The blue value of the color object. 0~255
a
The 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) -> Self
Parameters
hex
The hex value of the color object
a
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
A 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) -> Self
Parameters
value
A 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) -> Self
Parameters
value
A 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) -> Self
Parameters
value
true 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) -> Self
Parameters
value
Options 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) -> Self
Parameters
value
The 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) -> Self
Parameters
r
The red value of the color object. 0~255
g
The green value of the color object. 0~255
b
The blue value of the color object. 0~255
a
The 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) -> Self
Parameters
hex
The hex value of the color object
a
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
A 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) -> Self
Parameters
value
The 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) -> Self
Parameters
topLeft
The radius of this view’s top left corner.
topRight
The radius of this view’s top right corner.
bottomLeft
The radius of this view’s bottom left corner.
bottomRight
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
value
The 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) -> Self
Parameters
r
The red value of the color object. 0~255
g
The green value of the color object. 0~255
b
The blue value of the color object. 0~255
a
The 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) -> Self
Parameters
hex
The hex value of the color object
a
The 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?) -> Self
Parameters
value
The 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) -> Self
Parameters
r
The red value of the color object. 0~255
g
The green value of the color object. 0~255
b
The blue value of the color object. 0~255
a
The 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) -> Self
Parameters
hex
The hex value of the color object
a
The 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) -> Self
Parameters
offset
The offset of the layer’s shadow.
radius
The radius of the layer’s shadow.
opacity
The 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) -> Self
Parameters
color
The color of the layer’s shadow.
offset
The offset of the layer’s shadow.
radius
The radius of the layer’s shadow.
opacity
The opacity of the layer’s shadow.
corners
The 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?) -> Self
Parameters
startColor
The start color of the gradient.
endColor
The end color of the gradient.
direction
The direction of the gradient.
Return Value
Self
-
hidKeyBoard(_:
Extension method) hid key board
Declaration
Swift
@discardableResult public func hidKeyBoard(_ value: @autoclosure @escaping () -> Bool) -> Self
Parameters
value
resignFirstResponder when the value is true
Return Value
Self
-
showKeyBoard(_:
Extension method) show key board
Declaration
Swift
@discardableResult public func showKeyBoard(_ value: @autoclosure @escaping () -> Bool) -> Self
Parameters
value
becomeFirstResponder 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
isCALayer
true if is calayer.
isDirty
true if the attribute may change the view layout
selector
The selector of the attribute.
patamter
patamter.
-
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
isCALayer
true if is calayer.
isDirty
true if the attribute may change the view layout
selector
The selector of the attribute.
patamter
patamter.
-
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) -> Self
Parameters
value
An 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?) -> Self
Parameters
value
The 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) -> Self
Parameters
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.
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() -> Self
Return Value
Self
-
cleanGradientLayer()
Extension methodClean the view’s background gradient color.
Declaration
Swift
@discardableResult public func cleanGradientLayer() -> Self
Return 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) -> Self
Parameters
style
The intensity of the blur effect. See UIBlurEffect.Style for valid options.
alpha
The alpha of the blur effect.
color
The color of the blur effect.
Return Value
Self
-
removeBlurEffect()
Extension methodRemoves blur effect.
Declaration
Swift
@discardableResult public func removeBlurEffect() -> Self
Return Value
Self
-
alert(_:
Extension method) Add alert View
Declaration
Swift
@discardableResult public func alert(_ content: () -> AlertView) -> Self
Parameters
content
the builder of alert View
Return Value
self
-
progressViewStyle(style:
Extension method) Undocumented
Declaration
Swift
public func progressViewStyle<S>(style: S) -> View where S : ProgressViewStyle