Skip to content

Commit e831b96

Browse files
authored
Update README.md
1 parent 9be75d5 commit e831b96

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,14 @@ let actions: [UIControlViewAction] = [
9191
}),
9292
.init(item: .onlyTitle("Item 2"), tintColor: .customHEX("#0C5AA9"), backColor: .custom(.blue), handler: { _ in
9393
}),
94-
.init(item: .onlyIcon(UIImage(systemName: "trash")!), tintColor: .custom(.red), backColor: .custom(.red), handler: { _ in
95-
})
94+
.init(item: .onlyTitle("Item with double action"),
95+
selectionConfig: .backWithBorder(.systemPurple),
96+
isPreselected: true,
97+
isSelected: { _ in
98+
//Selected
99+
}, isUnselected: { _ in
100+
//Unselected
101+
})
96102
]
97103

98104
view.showHideIndicator = false
@@ -104,6 +110,26 @@ view.delegate = self
104110
view.show(self, type: .actions(actions))
105111
```
106112

113+
## Item action
114+
115+
Single action
116+
```swift
117+
.init(item: .onlyTitle("Item with single action"), tintColor: .customHEX("#0C5AA9"), backColor: .custom(.blue), handler: { _ in
118+
}),
119+
```
120+
121+
Double action
122+
```swift
123+
.init(item: .onlyTitle("Item with double action"),
124+
selectionConfig: .backWithBorder(.systemPurple),
125+
isPreselected: true,
126+
isSelected: { _ in
127+
//Selected
128+
}, isUnselected: { _ in
129+
//Unselected
130+
}),
131+
```
132+
107133
## Color
108134

109135
<img src="https://github.com/VladK9/UIControlView/blob/main/Assets/ColorView.jpeg" width="330">

0 commit comments

Comments
 (0)