55
66# ButtonClickStyle
77
8- [ ![ Version] ( https://img.shields.io/cocoapods/v/ButtonClickStyle.svg?style=flat )] ( https://cocoapods.org/pods/ButtonClickStyle )
9- [ ![ License] ( https://img.shields.io/cocoapods/l/ButtonClickStyle.svg?style=flat )] ( https://cocoapods.org/pods/ButtonClickStyle )
108[ ![ Platform] ( https://img.shields.io/cocoapods/p/ButtonClickStyle.svg?style=flat )] ( https://cocoapods.org/pods/ButtonClickStyle )
9+ [ ![ Version] ( https://img.shields.io/cocoapods/v/ButtonClickStyle.svg?style=flat )] ( https://cocoapods.org/pods/ButtonClickStyle )
1110[ ![ Xcode] ( https://img.shields.io/badge/Xcode-13-blue.svg )] ( https://developer.apple.com/xcode )
1211[ ![ Swift 5.0] ( https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat )] ( https://swift.org/ )
1312[ ![ Swift 5.2] ( https://img.shields.io/badge/Swift-5.5-orange.svg?style=flat )] ( https://swift.org/ )
1413[ ![ License] ( https://img.shields.io/github/license/almazrafi/Fugen.svg )] ( https://github.com/mrustaa/ButtonClickStyle/LICENSE )
1514
16- - This is a customizable/designable "button view" ,
15+ - This is a customizable/designable Button View ,
1716- with 15 animated click styles,
1817- that allows you to design your own buttons from subviews,
1918- in storyboard and xib right away.
2019
20+
21+
2122## Watch video with examples
2223
2324[ ▶️ Xcode Create in Storyboard/Xib] ( https://youtu.be/VNupvYMYPmk )
2627
2728[ ![ Xcode Create Storyboard/Xib] ( https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/XcodeCreateXib40.png )] ( https://youtu.be/VNupvYMYPmk )
2829
30+
31+
32+ - [ Requirements] ( #requirements )
33+ - [ Installation] ( #installation )
34+ - [ CocoaPods] ( #cocoapods )
35+ - [ Swift Package Manager with Xcode 13] ( #swift-package-manager-with-xcode-13 )
36+ - [ Getting Started] ( #getting-started )
37+ - [ Usage ` ButtonClickStyleView ` ] ( #usage-buttonclickstyleview )
38+ - [ Designable Attributes Storyboard/Xib files] ( #designable-attributes-storyboardxib-files )
39+ - [ Init Programmatically] ( #init-programmatically )
40+ - [ Addition ` ButtonClickStyleDesignView ` ] ( #addition-buttonclickstyledesignview )
41+ - [ Author] ( #author )
42+ - [ License] ( #license )
43+
44+
45+
46+
2947## Requirements
3048
3149- Xcode 13+
3250- iOS 9.0+
3351- Swift 5.5+
3452
53+
3554## Installation
3655
3756### CocoaPods
@@ -42,77 +61,109 @@ it, simply add the following line to your Podfile:
4261``` ruby
4362pod ' ButtonClickStyle'
4463```
64+ ### Swift Package Manager with Xcode 13
65+
66+ Follow [ this doc] ( https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app ) .
67+
68+
4569
46- ## Usage
4770
48- #### With storyboard or xib files
71+ ## Getting Started
4972
50- 1 ) Create a "view" that inherits from ` ButtonClickStyleView `
73+ ### Usage ` ButtonClickStyleView `
5174
52- 2 ) Inside this layer, create your own button
75+ #### Designable Attributes Storyboard/Xib files
5376
54- 3 ) In Attributes Inspector of Interface Builder
55- you can immediately select the button click style ` animationType `
77+ 1 ) Create a ` UIView ` that inherits from ` ButtonClickStyleView `
78+
79+ 2 ) Inside this View, create design your own button from subviews
80+
81+ 3 ) In Attributes Inspector of Interface Builder,
82+ you can immediately select the button click style ` animType `
83+
84+ - IBDesignable ...... | ` animType ` ........ | Number Value | Init Interface Builder
85+ - ButtonClick.State | ` animationType ` | Number Value | Init Programmatiсaly State
5686
5787![ image] ( https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/click_styles_example_2x_10sec33fps.gif )
5888
5989``` swift
60- extension ButtonClick { // animationType
61- enum Style {
62- case alpha
63- case flash
64- case shadow
65- case shadowColor
66- case color
67- case colorFlat
68- case pulsateNew
69- case pulsate
70- case press
71- case shake
72- case shakeNew
73- case androidClickable
74- case androidClickableDark
75- case fave
76- case glare
90+ extension ButtonClick {
91+ // Number Value
92+ enum Style {
93+ case alpha // 0
94+ case flash // 1
95+ case shadow // 2
96+ case shadowColor // 3
97+ case color // 4
98+ case colorFlat // 5
99+ case pulsateNew // 6
100+ case pulsate // 7
101+ case press // 8
102+ case shake // 9
103+ case shakeNew // 10
104+ case androidClickable // 11
105+ case androidClickableDark // 12
106+ case fave // 13
107+ case glare // 14
77108 }
78109}
79110```
80111
81- 4 ) Also you can select specific layers to animate / or just 1 specific one ` allSubviews `
112+ 4 ) Also you can select specific subviews to animate / or just 1 specific one-view ` allSubviews `
82113
83- 5 ) Add animation duration ` animationDuration `
114+ 5 ) Add animation duration ` animDuration `
84115
85- 6 ) Add animation value ` animationTypeValue ` - meaning means for some types - alpha or power
116+ 6 ) Add animation value ` animValue ` - meaning means for some types - alpha or power
86117
87- - Hide
88- .Alpha / .Flash
118+ - Hide
119+ .Alpha / .Flash
89120 Will change alpha for "self.view" from 0.0 to 1.0
90-
121+
91122- Add
92- .Shadow / .Color / .ColorFlat
123+ .Shadow / .Color / .ColorFlat
93124 Will change alpha for "add.view" from 0.0 to 1.0
94125
95126- Move
96- .Pulsate / .Press / .Shake
127+ .Pulsate / .Press / .Shake
97128 Will change the strength of movement for "self.view" from 0.0 to 1.0
98129
99- - Tap Gesture
100- .Fave / .AndroidClickable
130+ - Tap Gesture
131+ .Fave / .AndroidClickable
101132 Will increase bubble radius for "add.view"
102133
103134- Loading
104- .Glare
135+ .Glare
105136 No change for "add.view"
106137
138+
139+
140+ #### Addition ` ButtonClickStyleDesignView `
141+
142+ Also you can use in special custom Designable ` ButtonClickStyleDesignView ` or ` ButtonClickStyleDesignLabel `
143+ with bunch of options, adding
144+ + cornerRadius
145+ + figure type
146+ + gradient
147+ + shadows
148+ + borders
149+ + blur
150+ + etc
151+
107152<!--  -->
108153
109- ## Init Programmatically
110154
111- 7 ) If initializing programmatically
155+
156+ ### Init Programmatically
157+
158+ If initializing programmatically
112159There is a property ` addViews ` - allows you to pass views / layers
113160which you definitely want to use in the click animation only
114161
115- 8 ) Or initialize through a struct ` ButtonClick.State `
162+
163+
164+ #### Usage ` ButtonClick.State `
165+
166+ Or initialize through a struct ` ButtonClick.State `
116167
117168``` swift
118169import ButtonClickStyle
0 commit comments