Skip to content

Commit 58fc3e1

Browse files
Update README.md
1 parent b24b7ec commit 58fc3e1

1 file changed

Lines changed: 28 additions & 10 deletions

File tree

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,44 @@ enum Style {
6565

6666
```swift
6767
@IBInspectable var allSubviews: Bool = true
68-
@IBInspectable var animationType: Int =
68+
@IBInspectable var animationType: Int = 0
6969
@IBInspectable var animationValue: CGFloat = 0.0
7070
@IBInspectable var animationDuration: CGFloat = 0.0
7171

7272
var addViews: [UIView]?
7373
```
7474

7575
7) If initializing programmatically
76-
- There is a property `addViews` - allows you to pass views / layers
77-
which you definitely want to use in the click animation only
76+
There is a property `addViews` - allows you to pass views / layers
77+
which you definitely want to use in the click animation only
7878

79+
8) Or initialize through a struct `BtnCellState`
7980

8081
```swift
81-
let btnView = ButtonClickStyleView(
82-
frame: @frame,
83-
animation: @type,
84-
value: @value,
85-
addViews: @views,
86-
)
87-
btnView.insertSubview(self.view, at: 0)
82+
struct BtnCellState: Equatable {
83+
var titleText: String?
84+
var allSubviews: Bool = true
85+
var animationType: Int?
86+
var animationTypeValue: CGFloat?
87+
var animationDuration: CGFloat?
88+
var new: Bool = false
89+
var color: UIColor?
90+
var addBackgrondColor: Bool = true
91+
}
92+
```
93+
94+
```swift
95+
@IBOutlet var mainView: UIView!
96+
97+
var views: [UIView]? = [mainView]
98+
let frame: CGRect = .init(x: 23 , y: 22, width: 156, height: 48)
99+
let viewAn = ButtonClickStyleView(
100+
state: state,
101+
frame: frame,
102+
radius: 20,
103+
addViews: views
104+
)
105+
btnView.insertSubview(mainView, at: 0)
88106
btnView.updateSubviews()
89107

90108
```

0 commit comments

Comments
 (0)