You can select specific properties of objects in the project, interaction nodes, components, variables, and the iOS device the prototype is viewed on.
You can use these properties in equations, conditional statements, and functions.
Object Properties
To use the current value of an object’s property, use this structure:
objectName.property
For example, let's say you're building an onboarding flow with a progress bar. You want to fill the progress bar stack when the user taps a button, so you need to know the width of the progress bar stack. You would use...
ProgressContainer.width
You can find a list of all object properties at the bottom of this article.
Trigger Properties
You can also use properties from the trigger that the interaction uses.
For example, let's say you want to use the exact X location that a user touched the screen. That value comes from this expression:
Tap.locationX
You may also type this in as:
trigger.locationX
You can find a list of trigger properties at the bottom of this article.
Device Properties
You can also use properties from the user's device to make your app responsive.
For example, let's say you're creating a scrolling progress bar. To set the progress bar's width, you'll need the device's width, which varies across iPhone models. That value comes from this expression:
device.screenWidth
Multiply that value by the page's scroll percent...
self.percentScrolledY
You'll see the expression outputs a number which will be the progress bar's width, changing throughout the scroll.
You can find a list of all device properties at the bottom of this article.
Selection Helpers
In the scrolling progress bar example above, we used "self" in the expression to find a property value. Self is a selection helper that refers to the object on which the interaction is placed.
Parent and Trigger are other selection helpers. Parent refers to the parent of the object the interaction is on. Trigger refers to the interaction's trigger.
Selection helpers work the same way object and device properties do with the same syntax. For example:
self.scaleX
parent.childCount
Tap.locationX
Variables
You can use any variable that is within the scope of the interaction (i.e. component variables can only be used in interactions on the component and its instances). You can either:
Type the variable’s name directly into the editor
Type the page or component name plus “.” and select the applicable variable
Type “#” and select from a full list of variables
The Expression Editor will show...
#variablename
Array Variable Properties
You can use properties from an array variable in your project.
For example, let's say you want to see how many items are currently in an array. That value comes from this expression:
#ArrayVariable.count
You can find a list of all array properties at the bottom of this article.
Glossary
Object Properties
.borderBottomLeftRadius
.borderBottomRightRadius
.borderTopLeftRadius
.borderTopRightRadius
.childCount: Number of children in the selected object
.gaugeStartValue
.height
.index: Current order of the selected object
.insetBottom
.insetLeft
.insetRight
.insetTop
.isHidden
.isScrollEnabled
.isZoomEnabled
.layerBlur
.left: Position of the object’s left edge in relation to its parent’s alignment
.marginBottom
.marginLeft
.marginRight
.marginTop
.maxX: Value of the object’s right edge within its parent
.maxY: Value of the object’s bottom edge within its parent
.maxZoomScale
.midX: Value of the object’s horizontal mid-point within its parent
.midY: Value of the object’s vertical mid-point within its parent
.minX: Value of the object’s left edge within its parent
.minY: Value of the object’s top edge within its parent
.minZoomScale
.opacity
.originX: The initial horizontal position when Play Mode begins
.originY: The initial vertical position when Play Mode begins
.paddingBottom
.paddingLeft
.paddingRight
.paddingTop
.parent: The parent of the object
.parentX: The horizontal position of this object’s parent
.parentY: The vertical position of this object’s parent
.percentScrollX: A value between 0 - 1 based on the object’s horizontal scroll
.percentScrollY: A value between 0 - 1 based on the object’s vertical scroll
.position
.progressiveBlur
.rotationX
.rotationY
.scale
.scaleX
.scaleY
.screenX
.screenY
.scrollIndexX
.scrollIndexY
.scrollX: Object’s horizontal scroll in PTs
.scrollY: Object’s vertical scroll in PTs
.stackAxis
.stackGap
.state
.top: Position of the object’s left edge in relation to its parent’s alignment
.translateX
.translateY
.translateZ
.userInterfaceStyle
.width
.zIndex
.zoomScale
.triggerProperty
Trigger Properties
Tap
.numberOfTaps: Number of taps set on the trigger
.numberOfTouches: Number of fingers used to tap
Touch
.numberOfTouches: Number of fingers used to tap
.locationX: The horizontal location of your finger in relation to the object this trigger is on
.locationY: The vertical location of your finger in relation to the object this trigger is on
Long Press
.minimumPressDuration: Duration set on the Long Press trigger
.numberOfTouches: Number of fingers used to press
Scroll
.offsetX: Amount scrolled horizontally in PTs
.offsetY: Amount scrolled vertically in PTs
.velocityX: Horizontal velocity of your finger while scrolling
.velocityY: Vertical velocity of your finger while scrolling
Pan
.deltaX: Distance your finger moves horizontally from A to B
.deltaY: Distance your finger moves vertically from A to B
.locationX: The horizontal location of your finger in relation to the object this trigger is on
.locationY: The vertical location of your finger in relation to the object this trigger is on
.translationX: The horizontal distance of the pan: Left (-) & Right (+)
.translationY: The vertical distance of the pan: Up (-) & Down (+)
.velocityX: Horizontal velocity of your finger while panning
.velocityY: Vertical velocity of your finger while panning
Loop
.count: Total number of children in the loop
.children: Target each child in the loop
.index: The index number of each child in the loop
.(target): The target of the Loop Children Action
Device Properties
.isPad
.safeAreaTop
.safeAreaBottom
.isPhone
.deviceWidth
.deviceHeight
Array Variable Properties
.count: Total number of item in the array
.append(item): Appends an item to the end of the array
.contains(item): Boolean value for if the item exists in the array
.first(): Returns the first item in the array
.insert(index, item): Inserts an item to a specified index in the array
.isEmpty(): Boolean value for if the array is empty
.item(index): Returns the item at the specified index
.last(): Returns the last item in the array
.remove(index): Removes the array item at the specified index
.removeAll(): Removes all items in the array
.removeFirst(): Removes the first item in the array
.removeLast(): Removes the last item in the array
.replace(index, item): Replaces an item at a specified index with a new item