<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchBar/setPositionAdjustment(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISearchBar(im)setPositionAdjustment:forSearchBarIcon:"
  },
  "title" : "setPositionAdjustment(_:for:)"
}
-->

# setPositionAdjustment(_:for:)

Returns the position adjustment for a given icon.

```
func setPositionAdjustment(_ adjustment: UIOffset, for icon: UISearchBar.Icon)
```

## Parameters

`adjustment`

The offset to use for the icon identified by `icon`.

`icon`

An icon identifier constant.

## Discussion

Use this method to adjust the position of an icon within the search text field.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)