---
title: "init(image:style:target:action:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uibarbuttonitem/init(image:style:target:action:)"
---

# init(image:style:target:action:)

Creates an item using the specified image, style, target, and action.

## Declaration

```swift
convenience init(image: UIImage?, style: UIBarButtonItem.Style, target: Any?, action: Selector?)
```

## Parameters

- `image`: The item’s image. If nil, an image doesn’t appear. The images displayed on the bar derive from this image. If this image is too large to fit on the bar, it’s scaled to fit. Typically, the size of a toolbar and navigation bar image is 20 x 20 points. The system uses the alpha values in the source image to create the images, ignoring opaque values.
- `style`: The style of the item. For possible values, see doc://com.apple.uikit/documentation/UIKit/UIBarButtonItem/Style-swift.enum.
- `target`: The object that receives the action message.
- `action`: The action to send to target when a person selects this item.

## Return Value

Return Value A newly initialized UIBarButtonItem.

## See Also

### Related Documentation

- [init(barButtonSystemItem:target:action:)](uikit/uibarbuttonitem/init(barbuttonsystemitem:target:action:).md)

### Creating items of a specific style

- [init(title:style:target:action:)](uikit/uibarbuttonitem/init(title:style:target:action:).md)
- [init(image:landscapeImagePhone:style:target:action:)](uikit/uibarbuttonitem/init(image:landscapeimagephone:style:target:action:).md)
