---
title: springField()
framework: uikit
role: symbol
role_heading: Type Method
path: uikit/uifieldbehavior/springfield()
---

# springField()

Creates and returns a spring field behavior.

## Declaration

```swift
class func springField() -> Self
```

## Return Value

Return Value A field behavior object that applies spring effects to items.

## Discussion

Discussion A spring field behavior object uses Hooke’s law to calculate the force applied to objects in the field. With this law, the amount of force is linearly proportional to the distance from the center of the field. An item entering this field oscillates with a period proportional to the inverse of its density. You can use this field behavior to keep items confined to a particular region. Use the item’s resistance to reduce its linear velocity (and thus the amount of oscillation) over time. An item in a spring field oscillates continuously unless the spring forces are damped by friction or the item is affected by other fields.

## See Also

### Getting the field behaviors

- [dragField()](uikit/uifieldbehavior/dragfield().md)
- [velocityField(direction:)](uikit/uifieldbehavior/velocityfield(direction:).md)
- [electricField()](uikit/uifieldbehavior/electricfield().md)
- [magneticField()](uikit/uifieldbehavior/magneticfield().md)
- [radialGravityField(position:)](uikit/uifieldbehavior/radialgravityfield(position:).md)
- [linearGravityField(direction:)](uikit/uifieldbehavior/lineargravityfield(direction:).md)
- [vortexField()](uikit/uifieldbehavior/vortexfield().md)
- [noiseField(smoothness:animationSpeed:)](uikit/uifieldbehavior/noisefield(smoothness:animationspeed:).md)
- [turbulenceField(smoothness:animationSpeed:)](uikit/uifieldbehavior/turbulencefield(smoothness:animationspeed:).md)
- [field(evaluationBlock:)](uikit/uifieldbehavior/field(evaluationblock:).md)
