Skip to content

Commit a6f4bbe

Browse files
committed
update ver 1.2.0
1 parent 96d28b0 commit a6f4bbe

22 files changed

+182
-121
lines changed

ButtonClickStyle.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'ButtonClickStyle'
11-
s.version = '1.1.1'
11+
s.version = '1.2.0'
1212
s.summary = 'This is a customizable designable button view. Inside layer you can style button, create your own subviews. Choose 15 click animation styles'
1313

1414
# This description is used to generate tags and improve search results.

Example/ButtonClickStyle.xcodeproj/project.pbxproj

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,31 @@
232232
sourceTree = "<group>";
233233
};
234234
4A14CBC22803437C00DA8A68 /* ButtonClickStyle */ = {
235+
isa = PBXGroup;
236+
children = (
237+
4A477AC9280AEE280004156A /* Animations */,
238+
4A477ACA280AEE3D0004156A /* UIDesignable */,
239+
4A477ACB280AEE610004156A /* Style */,
240+
4A14CBCE2803437C00DA8A68 /* ButtonClickStyleAddViewsAnimation.swift */,
241+
4A14CBDA2803437C00DA8A68 /* ButtonClickStyleView.swift */,
242+
4A14CBCC2803437C00DA8A68 /* ButtonClick.swift */,
243+
4A14CBCB2803437C00DA8A68 /* ButtonClickState.swift */,
244+
4A14CBCD2803437C00DA8A68 /* ButtonClicClosure.swift */,
245+
4A14CBC92803437C00DA8A68 /* ButtonClickStyleGestureRecognizer.swift */,
246+
);
247+
path = ButtonClickStyle;
248+
sourceTree = "<group>";
249+
};
250+
4A4545C22806C7570041D039 /* ButtonTableList */ = {
251+
isa = PBXGroup;
252+
children = (
253+
4A4545C32806C7570041D039 /* ButtonTableListViewController.swift */,
254+
4A4545C42806C7570041D039 /* ButtonTableListViewController.storyboard */,
255+
);
256+
path = ButtonTableList;
257+
sourceTree = "<group>";
258+
};
259+
4A477AC9280AEE280004156A /* Animations */ = {
235260
isa = PBXGroup;
236261
children = (
237262
4A14CBD02803437C00DA8A68 /* ButtonClickStyleAnim+UIViewAlpha.swift */,
@@ -245,29 +270,28 @@
245270
4A14CBD82803437C00DA8A68 /* ButtonClickStyleAnim+UIViewFlash.swift */,
246271
4A14CBD92803437C00DA8A68 /* ButtonClickStyleAnim+UIViewPress.swift */,
247272
4A85B5A22803D59800DFD435 /* ButtonClickStyleAnim+UIViewGlare.swift */,
273+
);
274+
path = Animations;
275+
sourceTree = "<group>";
276+
};
277+
4A477ACA280AEE3D0004156A /* UIDesignable */ = {
278+
isa = PBXGroup;
279+
children = (
248280
4A62F30D2803115C00534ABA /* ButtonClickStyleDesignLabel.swift */,
249281
4A62F30E2803115C00534ABA /* ButtonClickStyleDesignView.swift */,
250-
4A14CBC52803437C00DA8A68 /* ButtonClickStyleShort.swift */,
251-
4A14CBC62803437C00DA8A68 /* ButtonClickStyle.swift */,
252-
4A231B79280A82250073284C /* ButtonClickStyleEmoji.swift */,
253-
4A14CBC72803437C00DA8A68 /* ButtonClickStyleBase.swift */,
254-
4A14CBC92803437C00DA8A68 /* ButtonClickStyleGestureRecognizer.swift */,
255-
4A14CBCE2803437C00DA8A68 /* ButtonClickStyleAddViewsAnimation.swift */,
256-
4A14CBDA2803437C00DA8A68 /* ButtonClickStyleView.swift */,
257-
4A14CBCB2803437C00DA8A68 /* ButtonClickState.swift */,
258-
4A14CBCC2803437C00DA8A68 /* ButtonClick.swift */,
259-
4A14CBCD2803437C00DA8A68 /* ButtonClicClosure.swift */,
260282
);
261-
path = ButtonClickStyle;
283+
path = UIDesignable;
262284
sourceTree = "<group>";
263285
};
264-
4A4545C22806C7570041D039 /* ButtonTableList */ = {
286+
4A477ACB280AEE610004156A /* Style */ = {
265287
isa = PBXGroup;
266288
children = (
267-
4A4545C32806C7570041D039 /* ButtonTableListViewController.swift */,
268-
4A4545C42806C7570041D039 /* ButtonTableListViewController.storyboard */,
289+
4A14CBC52803437C00DA8A68 /* ButtonClickStyleShort.swift */,
290+
4A14CBC62803437C00DA8A68 /* ButtonClickStyle.swift */,
291+
4A231B79280A82250073284C /* ButtonClickStyleEmoji.swift */,
292+
4A14CBC72803437C00DA8A68 /* ButtonClickStyleBase.swift */,
269293
);
270-
path = ButtonTableList;
294+
path = Style;
271295
sourceTree = "<group>";
272296
};
273297
4A62F3102803115C00534ABA /* LoadNib */ = {
@@ -1020,7 +1044,7 @@
10201044
DEVELOPMENT_TEAM = Y7546NLJW9;
10211045
INFOPLIST_FILE = ButtonClickStyle/Info.plist;
10221046
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1023-
MARKETING_VERSION = 1.1.1;
1047+
MARKETING_VERSION = 1.2.0;
10241048
MODULE_NAME = ExampleApp;
10251049
PRODUCT_BUNDLE_IDENTIFIER = mrusta.ButtonClickStyle;
10261050
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1041,7 +1065,7 @@
10411065
DEVELOPMENT_TEAM = Y7546NLJW9;
10421066
INFOPLIST_FILE = ButtonClickStyle/Info.plist;
10431067
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1044-
MARKETING_VERSION = 1.1.1;
1068+
MARKETING_VERSION = 1.2.0;
10451069
MODULE_NAME = ExampleApp;
10461070
PRODUCT_BUNDLE_IDENTIFIER = mrusta.ButtonClickStyle;
10471071
PRODUCT_NAME = "$(TARGET_NAME)";

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pod 'ButtonClickStyle'
4444
3) In Attributes Inspector of Interface Builder
4545
you can immediately select the button click style `animationType`
4646

47-
4847
![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/click_styles_example_2x_10sec33fps.gif)
4948

5049
```swift
@@ -74,58 +73,73 @@ extension ButtonClick {
7473
5) Add animation duration `animationDuration`
7574

7675
6) Add animation value `animationTypeValue` - meaning means
77-
- "Hide .Alpha/Flash/Shadow/Color" - will change alpha from 0.0 to 1.0
78-
- "Move .Pulsate/Press/Shake" - will increase movement decrease from 0.0 to 1.0
79-
- "Add .AndroidClickable" - will increase bubble radius
80-
81-
82-
```swift
83-
@IBInspectable var allSubviews: Bool = true
84-
@IBInspectable var animationType: Int = 0
85-
@IBInspectable var animationValue: CGFloat = 0.0
86-
@IBInspectable var animationDuration: CGFloat = 0.0
87-
88-
var addViews: [UIView]?
89-
```
76+
- "Hide .Alpha/.Flash" - will change alpha from 0.0 to 1.0
77+
- "Add .Shadow/.Color/.ColorFlat"
78+
- "Move .Pulsate/.Press/.Shake" - will increase movement decrease from 0.0 to 1.0
79+
- "TapGesture .Fave/.AndroidClickable" - will increase bubble radius
80+
- "Loading .Glare" -
9081

9182
<!-- ![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/ui3.gif) -->
9283

9384
7) If initializing programmatically
9485
There is a property `addViews` - allows you to pass views / layers
9586
which you definitely want to use in the click animation only
9687

97-
```swift
98-
@IBOutlet var mainView: UIView!
99-
100-
var views: [UIView]? = [mainView]
101-
let frame: CGRect = .init(x: 23 , y: 22, width: 156, height: 48)
102-
let viewAn = ButtonClickStyleView(
103-
state: state,
104-
frame: frame,
105-
radius: 20,
106-
addViews: views
107-
)
108-
btnView.insertSubview(mainView, at: 0)
109-
btnView.updateSubviews()
110-
111-
```
112-
113-
11488
8) Or initialize through a struct `ButtonClick.State`
11589

11690
```swift
117-
extension ButtonClick {
118-
struct State: Equatable {
119-
var titleText: String?
120-
var allSubviews: Bool = true
121-
var animationType: Int?
122-
var animationTypeValue: CGFloat?
123-
var animationDuration: CGFloat?
124-
var new: Bool = false
125-
var color: UIColor?
126-
var startClick: Bool = false
127-
var debugButtonShow: Bool = false
128-
var addBackgrondColor: Bool = true
91+
import ButtonClickStyle
92+
import UIKit
93+
94+
class ViewController: UIViewController {
95+
96+
@IBOutlet var xibButtonClickStyleView: ButtonClickStyleView?
97+
98+
var prgmButtonClickStyleView: ButtonClickStyleView?
99+
var prgmFigureView: UIView!
100+
var prgmRectangleView: UIView!
101+
102+
//MARK: - Create Programmaticaly
103+
104+
override func viewDidLoad() {
105+
super.viewDidLoad()
106+
107+
let figureView = UIView(frame: .init(x: 50, y: 10, width: 80, height: 40))
108+
figureView.backgroundColor = .systemIndigo
109+
figureView.layer.cornerRadius = 20
110+
self.prgmFigureView = figureView
111+
112+
let rectangleView = UIView(frame: .init(x: 15, y: 50, width: 50, height: 60))
113+
rectangleView.backgroundColor = .systemPurple
114+
self.prgmRectangleView = rectangleView
115+
116+
let state = ButtonClick.State(
117+
titleText: "Hello", // debug text button
118+
allSubviews: true, // click animation all subviews
119+
animationType: 2, // style 15
120+
animationTypeValue: 0.5, // value - alpha/power move
121+
animationDuration: nil, // anim duration
122+
new: false, // same styles one of them new
123+
color: UIColor.green, // value color for styles shadowColor/color/colorFlat
124+
startClick: true, // animate on creation
125+
debugButtonShow: false, // debug highlight the real button inside
126+
addBackgrondColor: true // debug add background color/view
127+
)
128+
129+
let btnView = ButtonClickStyleView(
130+
state: state,
131+
frame: .init(x: 0, y: 300, width: 240, height: 128),
132+
radius: 20,
133+
addViews: [figureView] // addViews - allows you to pass views / layers which you definitely want to use in the click animation only
134+
)
135+
btnView.backgroundColor = .yellow.withAlphaComponent(0.5)
136+
137+
btnView.updateSubviews()
138+
self.prgmButtonClickStyleView = btnView
139+
140+
btnView.addSubview(figureView)
141+
btnView.addSubview(rectangleView)
142+
self.view.addSubview(btnView)
129143
}
130144
}
131145
```

0 commit comments

Comments
 (0)