Skip to content

Commit 66b558c

Browse files
update readme
1 parent cf4731f commit 66b558c

2 files changed

Lines changed: 64 additions & 49 deletions

File tree

ButtonClickStyle.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
4AC8BCD427FC65AA00F85008 /* TestDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AC8BC8F27FC65AA00F85008 /* TestDemoViewController.swift */; };
7878
4AC8BCD527FC65AA00F85008 /* ButtonLayerExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AC8BC9227FC65AA00F85008 /* ButtonLayerExampleView.swift */; };
7979
4AC8BCD627FC65AA00F85008 /* ButtonLayerExampleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4AC8BC9327FC65AA00F85008 /* ButtonLayerExampleView.xib */; };
80+
4AC8BCD827FC6B1100F85008 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 4AC8BCD727FC6B1100F85008 /* README.md */; };
8081
/* End PBXBuildFile section */
8182

8283
/* Begin PBXFileReference section */
@@ -152,6 +153,7 @@
152153
4AC8BC8F27FC65AA00F85008 /* TestDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestDemoViewController.swift; sourceTree = "<group>"; };
153154
4AC8BC9227FC65AA00F85008 /* ButtonLayerExampleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonLayerExampleView.swift; sourceTree = "<group>"; };
154155
4AC8BC9327FC65AA00F85008 /* ButtonLayerExampleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ButtonLayerExampleView.xib; sourceTree = "<group>"; };
156+
4AC8BCD727FC6B1100F85008 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
155157
/* End PBXFileReference section */
156158

157159
/* Begin PBXFrameworksBuildPhase section */
@@ -169,6 +171,7 @@
169171
isa = PBXGroup;
170172
children = (
171173
4AC8BC1E27FC652F00F85008 /* ButtonClickStyle */,
174+
4AC8BCD727FC6B1100F85008 /* README.md */,
172175
4AC8BC1D27FC652F00F85008 /* Products */,
173176
);
174177
sourceTree = "<group>";
@@ -561,6 +564,7 @@
561564
4AC8BCC527FC65AA00F85008 /* JustPinkButtonView.xib in Resources */,
562565
4AC8BC2727FC652F00F85008 /* Main.storyboard in Resources */,
563566
4AC8BCD327FC65AA00F85008 /* TestDemoViewController.storyboard in Resources */,
567+
4AC8BCD827FC6B1100F85008 /* README.md in Resources */,
564568
4AC8BCAB27FC65AA00F85008 /* Proxima Nova Semibold.otf in Resources */,
565569
4AC8BCD227FC65AA00F85008 /* TestViewController.storyboard in Resources */,
566570
4AC8BCBC27FC65AA00F85008 /* TestDemoSquaresButtonView.xib in Resources */,

README.md

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# ButtonCustomButtonClickStyle
1+
# ButtonClickStyle
2+
3+
## Preview
4+
![image](https://github.com/mrustaa/GifPresentations/blob/master/ButtonClickStyle/all_ipad_random.gif)
25

36
Это слой кнопка
4-
которая имеет 8 стилей анимированного нажатия
7+
которая имеет 9 стилей анимированного нажатия
58

69
Внутри Слоя
710
можно создавать свои собственные кнопки
@@ -12,79 +15,87 @@
1215

1316
## Requirements
1417

15-
- iOS 8.0+
16-
- Xcode 9+
18+
macOS 10.12+
19+
Xcode 13+
20+
Swift 5.5+
1721

1822
## Installation
1923

20-
For manual instalation, drag Source folder into your project.
21-
22-
os use [CocoaPod](https://cocoapods.org) adding this line to you `Podfile`:
23-
24-
```ruby
25-
pod 'ButtonCustomButtonClickStyle'
26-
```
27-
28-
for [Carthage](https://github.com/Carthage/Carthage) users, add this line to you `Cartfile`
2924

30-
```ruby
31-
github "mrustaa/ButtonCustomButtonClickStyle"
32-
```
25+
## Usage
3326

34-
### Swift Package Manager
27+
#### С storyboard или xib
3528

36-
The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
29+
1) Создайте вьюшку, которая наследуется `ButtonClickStyleView`
3730

38-
Once you have your Swift package set up, adding as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
31+
<!--You can now style your button (Теперь вы можете стилизовать свою кнопку )-->
32+
2) Внутри этого слоя, создавайте свою собственную кнопку из других слоев
3933

34+
3) В атрибутых инспектора (`Attributes Inspector` of `Interface Builder`
35+
вы можете сразу выбрать тип анимации нажатия кнопки `animationType`
36+
37+
Пока 9 стилей анимированного нажатия
4038
```swift
41-
dependencies: [
42-
.package(url: "https://github.com/sparrowcode/SPQRCode", .upToNextMajor(from: "1.0.4"))
43-
]
39+
#type #name
40+
41+
"Hide .Alpha"
42+
"Hide .Flash (more)"
43+
"Add .Shadow"
44+
"Add .Color"
45+
"Add .ColorFlat (border text)"
46+
"Move .Pulsate (new)"
47+
"Move .Pulsate"
48+
"Move .Press"
49+
"Move .Shake (new)"
50+
"Move .Shake"
51+
"Add .AndroidClickable (dark)"
52+
"Add .AndroidClickable (ligth)"
4453
```
4554

55+
4) Так же вы можете выбрать анимировать все слои `allSubviews` / или только 1
4656

47-
### Swift Package Manager
4857

49-
[Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
58+
5) Добавить + animation.Duration - время анимации
5059

51-
> Xcode 11+ is required to build Harbeth using Swift Package Manager.
60+
6) Добавить + animation.Value - под значением имеется ввиду
61+
у анимации тип
62+
- "Hide .Alpha/Flash/Shadow/Color" будет меняться альфа от 0.0 до 1.0
63+
- "Move .Pulsate/Press/Shake" будет движения усиливаться уменьшаться от 0.0 до 1.0
64+
- "Add .AndroidClickable" будет увелмчиваться радиус пузырей
5265

53-
To integrate Harbeth into your Xcode project using Swift Package Manager, add it to the dependencies value of your `Package.swift`:
5466

5567
```swift
56-
dependencies: [
57-
.package(url: "https://github.com/yangKJ/Harbeth", .upToNextMajor(from: "0.1.15")),
58-
]
59-
```
60-
68+
@IBInspectable var allSubviews: Bool = true
69+
@IBInspectable var animationType: Int =
70+
@IBInspectable var animationValue: CGFloat = 0.0
71+
@IBInspectable var animationDuration: CGFloat = 0.0
72+
73+
var addViews: [UIView]?
6174

75+
```
76+
7) Если иниализацируйие программно
77+
- Есть свойство `addViews` - позволяет передать вьшки/слои
78+
которые вы точно захотите задейстовать в анимации нажатия only
6279

63-
## Usage
64-
65-
#### With storyboard or xib files
66-
67-
1) Create a Button that inherits from `Button`
68-
69-
2) Add Image for a `Normal` state
70-
71-
3) Set the `IBOutlet` delegate property to a subclass of `ButtonDelegate`
72-
73-
4) ___Optional___ manipulate porperties to change button settings
7480

7581
```swift
76-
@IBInspectable public var normalColor: UIColor
77-
@IBInspectable public var selectedColor: UIColor
78-
@IBInspectable public var dotFirstColor: UIColor
79-
@IBInspectable public var dotSecondColor: UIColor
80-
@IBInspectable public var circleFromColor: UIColor
81-
@IBInspectable public var circleToColor: UIColor
82+
let btnView = ButtonClickStyleView(
83+
frame: @frame,
84+
animation: @type,
85+
value: @value,
86+
addViews: @views,
87+
)
88+
btnView.insertSubview(self.view, at: 0)
89+
btnView.updateSubviews()
90+
8291
```
8392

93+
94+
8495
## Credits
8596

8697

8798
## License
8899

89-
ButtonCustomButtonClickStyle is released under the MIT license.
100+
ButtonClickStyle is released under the MIT license.
90101

0 commit comments

Comments
 (0)