## Related terms

- mobile\-sdk
- ai\-recommendation

See the [glossary](/glossary.md) for definitions.

---

# Content Widget


### ContentWidget


Content Widget is a feature in our Software Development Kit that allows you to embed an easily customizable view with various types of content in your application.
  
**Declared In:**  
Headers/SNRContentWidget.h
  
**Related To:**  
[ContentWidgetOptions](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetoptions)  
[ContentWidgetAppearance](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetappearance)    
[ContentWidgetDelegate](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#content-widget-delegate)
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)
  
**Declaration:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-250">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-250-0" data-tab-group="tabgrp-250" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-250-1" data-tab-group="tabgrp-250">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-250-0" data-tab-group="tabgrp-250" data-tab-active="true">

```Swift
class ContentWidget: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-250-1" data-tab-group="tabgrp-250">

```Objective-C
@interface SNRContentWidget : NSObject
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **options** | [ContentWidgetOptions](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetoptions) | no | Business configuration of the widget |
| **appearance** | [ContentWidgetAppearance](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetappearance) | no | UI configuration of the widget |
| **delegate** | [ContentWidgetDelegate](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#content-widget-delegate) | no | Delegate of the widget |
  
**Initializers:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-251">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-251-0" data-tab-group="tabgrp-251" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-251-1" data-tab-group="tabgrp-251">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-251-0" data-tab-group="tabgrp-251" data-tab-active="true">

```Swift
init(options: ContentWidgetOptions, appearance: ContentWidgetAppearance)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-251-1" data-tab-group="tabgrp-251">

```Objective-C
- (instancetype)initWithOptions:(nonnull SNRContentWidgetOptions *)options andAppearance:(nonnull SNRContentWidgetAppearance *)appearance
```

</div>
</div>



**Methods:**

Starts operation of fetching data and creates view structure of widget.

<div class="content-tabs code-tabs" data-tab-group="tabgrp-252">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-252-0" data-tab-group="tabgrp-252" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-252-1" data-tab-group="tabgrp-252">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-252-0" data-tab-group="tabgrp-252" data-tab-active="true">

```Swift
func load()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-252-1" data-tab-group="tabgrp-252">

```Objective-C
- (void)load
```

</div>
</div>


---

Checks whether widget is loaded with success.

<div class="content-tabs code-tabs" data-tab-group="tabgrp-253">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-253-0" data-tab-group="tabgrp-253" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-253-1" data-tab-group="tabgrp-253">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-253-0" data-tab-group="tabgrp-253" data-tab-active="true">

```Swift
func isLoaded() -> Bool
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-253-1" data-tab-group="tabgrp-253">

```Objective-C
- (BOOL)isLoaded
```

</div>
</div>


---

Gets root view of whole widget view structure.

<div class="content-tabs code-tabs" data-tab-group="tabgrp-254">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-254-0" data-tab-group="tabgrp-254" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-254-1" data-tab-group="tabgrp-254">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-254-0" data-tab-group="tabgrp-254" data-tab-active="true">

```Swift
func getView() -> UIView
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-254-1" data-tab-group="tabgrp-254">

```Objective-C
- (UIView *)getView
```

</div>
</div>




---
---

### ContentWidgetAppearance


The **ContentWidgetAppearance** class is responsible for defining the appearance of the widget.
  
**Declared In:**  
Headers/SNRContentWidgetAppearance.h  
  
**Related To:**  
[SNRContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)   
[SNRContentWidgetLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetlayout)   
[SNRContentWidgetHorizontalSliderLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgethorizontalsliderlayout)   
[SNRContentWidgetGridLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetgridlayout)   
[SNRContentWidgetItemLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetitemlayout)  
[SNRContentWidgetBasicProductItemLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetbasicproductitemlayout)   
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)  
  
**Declaration:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-255">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-255-0" data-tab-group="tabgrp-255" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-255-1" data-tab-group="tabgrp-255">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-255-0" data-tab-group="tabgrp-255" data-tab-active="true">

```Swift
class ContentWidgetAppearance: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-255-1" data-tab-group="tabgrp-255">

```Objective-C
@interface SNRContentWidgetAppearance : NSObject
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **layout** | [ContentWidgetLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetlayout) | no | UI configuration of the widget's layout |
| **itemLayout** | [ContentWidgetItemLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetitemlayout) | no | UI configuration a single widget item |
  
**Initializers:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-256">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-256-0" data-tab-group="tabgrp-256" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-256-1" data-tab-group="tabgrp-256">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-256-0" data-tab-group="tabgrp-256" data-tab-active="true">

```Swift
init(widgetLayout: ContentWidgetLayout, itemLayout: ContentWidgetItemLayout)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-256-1" data-tab-group="tabgrp-256">

```Objective-C
- (instancetype)initWithLayout:(nonnull SNRContentWidgetLayout *)layout andItemLayout:(nonnull SNRContentWidgetItemLayout *)itemLayout
```

</div>
</div>




---
---

### ContentWidgetOptions
**Declared In:**  
Headers/SNRContentWidgetOptions.h  
  
**Related To:**  
[SNRContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)   
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-257">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-257-0" data-tab-group="tabgrp-257" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-257-1" data-tab-group="tabgrp-257">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-257-0" data-tab-group="tabgrp-257" data-tab-active="true">

```Swift
class ContentWidgetOptions: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-257-1" data-tab-group="tabgrp-257">

```Objective-C
@interface SNRContentWidgetOptions : NSObject
```

</div>
</div>


---
---

### ContentWidgetRecommendationsOptions


The **ContentWidgetRecommendationsOptions** class is responsible for defining the business logic options of the widget.
  
**Declared In:**  
Headers/SNRContentWidgetOptions.h
  
**Related To:**  
[SNRContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)   
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-258">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-258-0" data-tab-group="tabgrp-258" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-258-1" data-tab-group="tabgrp-258">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-258-0" data-tab-group="tabgrp-258" data-tab-active="true">

```Swift
class ContentWidgetRecommendationsOptions: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-258-1" data-tab-group="tabgrp-258">

```Objective-C
@interface SNRContentWidgetRecommendationsOptions : NSObject
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **slug** | String | no | Slug of a document |
| **productID** | String | yes | Product identifier for generating data |
| **mapping** | ((ContentWidgetRecommendationModel) -> (ContentWidgetRecommendationDataModel)) | no | Mapping block responsible for mapping data from the feed to a ContentWidgetRecommendationDataModel |
| **recommendationEventType** | ContentWidgetRecommendationEventType | - | Recommendation event type. <ul><li>**.view** sends all products in one event. We highly recommend using this type of event in content widget.</li><li>**.seen** sends each event as a separate event.</li></ul> |

**Initializers:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-259">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-259-0" data-tab-group="tabgrp-259" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-259-1" data-tab-group="tabgrp-259">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-259-0" data-tab-group="tabgrp-259" data-tab-active="true">

```Swift
init()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-259-1" data-tab-group="tabgrp-259">

```Objective-C
- (instancetype)init
```

</div>
</div>




---
---

### ContentWidgetLayout


Main widget layout abstract class for inheriting classes.
  
**Declared In:**  
Headers/SNRContentWidgetLayout.h
  
**Related To:**  
[SNRContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)   
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)
  
**Declaration:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-260">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-260-0" data-tab-group="tabgrp-260" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-260-1" data-tab-group="tabgrp-260">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-260-0" data-tab-group="tabgrp-260" data-tab-active="true">

```Swift
class ContentWidgetLayout: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-260-1" data-tab-group="tabgrp-260">

```Objective-C
@interface SNRContentWidgetLayout : NSObject
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **backgroundColor** | UIColor | yes | Background color of a widget |
| **insets** | UIEdgeInsets | yes | Inner widget margins in pt |
| **itemSize** | Size | yes | Size of a single item in pt |
| **numberOfItems** | Int | yes | It returns the number of items after the widget is loaded |


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**numberOfItems** property is read-only.

</div></div></div>




---
---

### ContentWidgetHorizontalSliderLayout


This layout is intended to present recommendations in a fixed-hight horizontal scrollable slider.
  
**Declared In:**
Headers/SNRContentWidgetHorizontalSliderLayout.h
  
**Related To:**  
[SNRContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)   
  
**Inherits From:**  
[ContentWidgetLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetlayout)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-261">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-261-0" data-tab-group="tabgrp-261" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-261-1" data-tab-group="tabgrp-261">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-261-0" data-tab-group="tabgrp-261" data-tab-active="true">

```Swift
class ContentWidgetHorizontalSliderLayout: ContentWidgetLayout
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-261-1" data-tab-group="tabgrp-261">

```Objective-C
@interface SNRContentWidgetHorizontalSliderLayout : SNRContentWidgetLayout
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **itemSpacing** | Float | yes | Horizontal spacing between items in pt |



---
---

### ContentWidgetGridLayout


This layout presents recommendations in a vertical scrollable grid, with elements organized into columns and rows. You can create a full- or half-screen widget.
  
**Declared In:**  
Headers/SNRContentWidgetGridLayout.h  
  
**Related To:**  
[SNRContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)   
  
**Inherits From:**  
[ContentWidgetLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetlayout)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-262">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-262-0" data-tab-group="tabgrp-262" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-262-1" data-tab-group="tabgrp-262">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-262-0" data-tab-group="tabgrp-262" data-tab-active="true">

```Swift
class ContentWidgetGridLayout: ContentWidgetLayout
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-262-1" data-tab-group="tabgrp-262">

```Objective-C
@interface SNRContentWidgetGridLayout : SNRContentWidgetLayout
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **itemHorizontalSpacing** | Float | yes | Horizontal spacing between items in pt |
| **itemVerticalSpacing** | Float | yes | Vertical spacing between items in pt |



---
---

### ContentWidgetItemLayout


Main widget layout item abstract class for inheriting classes.
  
**Declared In:**  
Headers/SNRContentWidgetItemLayout.h  
  
**Related To:**  
[ContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)  
[ContentWidgetAppearance](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetappearance)  
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)
  
**Declaration:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-263">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-263-0" data-tab-group="tabgrp-263" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-263-1" data-tab-group="tabgrp-263">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-263-0" data-tab-group="tabgrp-263" data-tab-active="true">

```Swift
class ContentWidgetItemLayout: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-263-1" data-tab-group="tabgrp-263">

```Objective-C
@interface SNRContentWidgetItemLayout : NSObject
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **backgroundColor** | UIColor | no | Background color of an item |
| **cornerRadius** | Float | no | Radius of the item corners |
| **borderWidth** | Float | no | Width of the item’s border |
| **borderColor** | UIColor | no | Color of the item’s border |
| **shadowColor** | UIColor | no | Color of the item’s shadow |



---
---

### ContentWidgetBasicProductItemLayout


This is the basic layout for items. It contains: the image, the title, and the price from the uploaded data.
  
**Declared In:**  
Headers/SNRContentWidgetBasicProductItemLayout.h
  
**Related To:**  
[ContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)  
[ContentWidgetAppearance](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetappearance)  
  
**Inherits From:**  
[ContentWidgetItemLayout](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetitemlayout)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-264">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-264-0" data-tab-group="tabgrp-264" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-264-1" data-tab-group="tabgrp-264">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-264-0" data-tab-group="tabgrp-264" data-tab-active="true">

```Swift
class ContentWidgetBasicProductItemLayout: ContentWidgetItemLayout
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-264-1" data-tab-group="tabgrp-264">

```Objective-C
@interface SNRContentWidgetBasicProductItemLayout : SNRContentWidgetItemLayout
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **imageWidthRatio** | Float | no | Image width. A ratio of 1.0 means that the image width equals to 100% of the entire height of the item |
| **imageHeightRatio** | Float | no | Image height. A ratio of 0.3 means that image height equals to 30% of the entire height of the item |
| **imageBackground** | UIColor | no | Background color of the image |
| **titleInsets** | UIEdgeInsets | no | Inner margins of the title label |
| **titleFont** | UIFont | no | Font of the item title label |
| **titleFontColor** | UIColor | no | Color of the title label |
| **titleAlignment** | NSTextAlignment | no | Alignment of the title label |
| **priceInsets** | UIEdgeInsets | no | Inner margins of the price label |
| **priceFont** | UIFont | no | Font of the price label |
| **priceFontColor** | UIColor | no | Color of the price label |
| **priceAlignment** | NSTextAlignment | no | Alignment of the price label |
| **priceGroupSeparator** | String | no | Separator of price group |
| **priceDecimalSeparator** | String | no | Separator of price decimal |
| **isSalePriceVisible** | Bool | no | Flag determining whether to show the sale price label or not |
| **salePriceOrientation** | UILayoutConstraintAxis | no | Orientation of the sale price label |
| **salePriceMargin** | Float | no | Margin between the price label and the sale price label |
| **regularPriceFont** | UIFont | no | Font of the regular price label |
| **regularPriceFontColor** | UIColor | no | Color of the regular price label |
| **salePriceFont** | UIFont | no | Font of the sale price label  |
| **salePriceFontColor** | UIColor | no | Color of the sale price label |
| **actionButton** | ContentWidgetImageButtonCustomAction | no | Optional button for your own custom action |
| **actionButtonPosition** | CGPoint | no | Position of the action button |



---
---

### ContentWidgetBaseCustomAction


Main widget custom action abstract class for inheriting classes.
  
**Declared In:**  
Headers/SNRContentWidgetItemLayout.h  
  
**Related To:**  
[ContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)  
[ContentWidgetAppearance](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetappearance)  
  
**Inherits From:**  
[NSObject](https://developer.apple.com/documentation/objectivec/nsobject)  
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-265">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-265-0" data-tab-group="tabgrp-265" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-265-1" data-tab-group="tabgrp-265">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-265-0" data-tab-group="tabgrp-265" data-tab-active="true">

```Swift
class ContentWidgetBaseCustomAction: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-265-1" data-tab-group="tabgrp-265">

```Objective-C
@interface SNRContentWidgetBaseCustomAction : NSObject
```

</div>
</div>


**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **predefinedActionType** | ContentWidgetBaseCustomActionPredefiniedActionType | no | It determines which event is on click |



---
---

### ContentWidgetImageButtonCustomAction


**ContentWidgetImageButtonCustomAction** is used to add an image button to your widget (only if the item layout allows). You can add a button with a single state or make it selectable.
  
**Declared In:**  
Headers/SNRContentWidgetImageButtonCustomAction.h
  
**Related To:**  
[ContentWidget](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidget)  
[ContentWidgetAppearance](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetappearance)  
  
**Inherits From:**  
[ContentWidgetBaseCustomAction](/developers/mobile-sdk/class-reference/ios/content-widget#contentwidgetbasecustomaction)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-266">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-266-0" data-tab-group="tabgrp-266" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-266-1" data-tab-group="tabgrp-266">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-266-0" data-tab-group="tabgrp-266" data-tab-active="true">

```Swift
class ContentWidgetImageButtonCustomAction: NSObject
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-266-1" data-tab-group="tabgrp-266">

```Objective-C
@interface SNRContentWidgetImageButtonCustomAction : NSObject
```

</div>
</div>

  
**Properties:**
| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| **size** | Size | yes | Button size |
| **backgroundColor** | UIColor | yes | Background color of the button |
| **tintColor** | UIColor | yes | Fill color of the button’s image, if an asset supports it |
| **image** | UIImage | yes | Button image |
| **isSelectable** | Bool | yes | Flag determining whether the button is selectable |
| **selectedImage** | UIImage | yes | Image of the button when the button is selected |
| **isSelected** | ContentWidgetImageButtonCustomActionIsSelectedBlock | yes | Block/closure to be executed when the widget needs to determine the state of a button in the cell |
| **onReceiveClick** | ContentWidgetImageButtonCustomActionReceiveClickBlock | yes | Block/closure to be executed when the button is clicked |



---
---

### ContentWidgetBaseCustomActionPredefiniedActionType
**Declared In:**  
Headers/SNRContentWidgetBaseCustomAction.h  
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-267">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-267-0" data-tab-group="tabgrp-267" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-267-1" data-tab-group="tabgrp-267">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-267-0" data-tab-group="tabgrp-267" data-tab-active="true">

```Swift
enum ContentWidgetBaseCustomActionPredefiniedActionType: Int {
    none,
    sendLikeEvent
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-267-1" data-tab-group="tabgrp-267">

```Objective-C
typedef NS_ENUM(NSUInteger, SNRContentWidgetBaseCustomActionPredefiniedActionType) {
    SNRContentWidgetBaseCustomActionPredefiniedActionTypeNone = 0,
    SNRContentWidgetBaseCustomActionPredefiniedActionTypeSendLikeEvent
}
```

</div>
</div>

