You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-13Lines changed: 27 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,20 @@ import ExpandableButton
21
21
```
22
22
23
23
## Usage
24
-
With `image` and `action`:
24
+
You can init **ExpandableButton** with `frame` (default is `.zero`), `direction` (default is `.right`) and items (each item will be button). `direction` is opening direction. `items` is `[ExpandableButtonItem]` whiches contain information about future buttons.
25
+
Diretions example:
26
+
```swift
27
+
let rightButton =ExpandableButtonView(frame: frame, direction: .right, items: items)
28
+
let leftButton =ExpandableButtonView(frame: frame, direction: .left, items: items)
29
+
let upButton =ExpandableButtonView(frame: frame, direction: .up, items: items)
30
+
let downButton =ExpandableButtonView(frame: frame, direction: .down, items: items)
|`contentEdgeInsets`|`UIEdgeInsets`|`.zero`|`contentEdgeInsets` for `UIButton`|
177
191
|`titleEdgeInsets`|`UIEdgeInsets`|`.zero`|`titleEdgeInsets` for `UIButton`. |
178
192
|`imageEdgeInsets`|`UIEdgeInsets`|`.zero`|`imageEdgeInsets` for `UIButton`. |
179
-
|`width`|`CGFloat?`|`nil`|`UIButton`width for current item. If `nil` will be equal to arrow button width. |
193
+
|`size`|`CGSize?`|`nil`|`UIButton`size for current item. If `nil` will be equal to arrow button size. |
180
194
|`titleAlignment`|`NSTextAlignment`|`.center`|`titleAlignment` for `titleLabel` in `UIButton`. |
181
195
|`imageContentMode`|`UIViewContentMode`|`.scaleAspectFit`|`imageContentMode` for `imageView` in `UIButton`.|
182
196
|`action`|`(ExpandableButtonItem) -> Void`|`{_ in}`| Action closure. Calls on `.touchUpInside`|
183
197
|`identifier`|`String`|`""`| Identifier for `ExpandableButtonItem`. |
184
198
185
199
186
-
You can also use [`ArrowButton`](ExpandableButton/ArrowButton.swift) (button which can drow leftand right arrow using core graphics, just call `showLeftArrow()`or `showRightArrow()`) and [`ActionButton`](ExpandableButton/ActionButton.swift) (simple `UIButton` but with `actionBlock` propertie which calls on `.touchUpInside`) in your projects.
200
+
You can also use [`ArrowButton`](ExpandableButton/ArrowButton.swift) (button which can drow left, right, up and down arrows using core graphics, just call `showLeftArrow()`, `showRightArrow()`, `showUpArrow()`or `showDownArrow()`) and [`ActionButton`](ExpandableButton/ActionButton.swift) (simple `UIButton` but with `actionBlock` propertie which calls on `.touchUpInside`) in your projects.
187
201
188
202
## License
189
203
**ExpandableButton** is under MIT license. See the [LICENSE](LICENSE) file for more info.
0 commit comments