Skip to content

Commit 34ae3a1

Browse files
Merge commit '6b45623ac20219d14c7f60df14bf96c7034c2304'
2 parents 53e7a66 + 6b45623 commit 34ae3a1

2 files changed

Lines changed: 135 additions & 40 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Be sure to run `pod lib lint ButtonClickStyle.podspec' to ensure this is a
3+
# valid spec before submitting.
4+
#
5+
# Any lines starting with a # are optional, but their use is encouraged
6+
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7+
#
8+
9+
Pod::Spec.new do |s|
10+
s.name = 'ButtonClickStyle'
11+
s.version = '1.3.1'
12+
s.summary = 'This is a customizable/designable Button-view, with 15 animated click styles, allows design custom buttons from subviews, in xib storyboard'
13+
14+
# This description is used to generate tags and improve search results.
15+
# * Think: What does it do? Why did you write it? What is the focus?
16+
# * Try to keep it short, snappy and to the point.
17+
# * Write the description between the DESC delimiters below.
18+
# * Finally, don't worry about the indent, CocoaPods strips it!
19+
20+
s.description = <<-DESC
21+
'This is a customizable/designable Button-view, with 15 animated click styles, allows design custom buttons from subviews, in xib storyboard'
22+
DESC
23+
24+
s.homepage = 'https://github.com/mrustaa/ButtonClickStyle'
25+
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
26+
s.license = { :type => 'MIT', :file => 'LICENSE' }
27+
s.author = { 'mrustaa' => 'rustamburger@gmail.com' }
28+
s.source = { :git => 'https://github.com/mrustaa/ButtonClickStyle.git', :tag => s.version.to_s }
29+
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
30+
s.swift_version = "5.0"
31+
32+
# s.ios.deployment_target = '14.0'
33+
s.platform = :ios, "14.0"
34+
35+
s.source_files = 'Sources/ButtonClickStyle/**/*.{swift}'
36+
37+
# s.resource_bundles = {
38+
# 'ButtonClickStyle' => ['ButtonClickStyle/Assets/*.png']
39+
# }
40+
41+
# s.public_header_files = 'Pod/Classes/**/*.h'
42+
# s.frameworks = 'UIKit', 'MapKit'
43+
# s.dependency 'AFNetworking', '~> 2.3'
44+
end

README.md

Lines changed: 91 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
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)
@@ -26,12 +27,30 @@
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
4362
pod '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
<!-- ![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/ui3.gif) -->
108153

109-
## Init Programmatically
110154

111-
7) If initializing programmatically
155+
156+
### Init Programmatically
157+
158+
If initializing programmatically
112159
There is a property `addViews` - allows you to pass views / layers
113160
which 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
118169
import ButtonClickStyle

0 commit comments

Comments
 (0)