Skip to content

Commit a7b191f

Browse files
Last fix
1 parent 3d42540 commit a7b191f

35 files changed

+2114
-176
lines changed

Example/ButtonClickStyle.xcodeproj/project.pbxproj

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
4A62F3A22803115C00534ABA /* ButtonLayerExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A62F3572803115C00534ABA /* ButtonLayerExampleView.swift */; };
8080
4A62F3A32803115C00534ABA /* ButtonLayerExampleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4A62F3582803115C00534ABA /* ButtonLayerExampleView.xib */; };
8181
4A62F3B92803122700534ABA /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A62F3B82803122700534ABA /* SceneDelegate.swift */; };
82+
4ADE26E42803837C00634B6C /* ExampleButtonsViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4ADE26E22803837C00634B6C /* ExampleButtonsViewController.storyboard */; };
83+
4ADE26E52803837C00634B6C /* ExampleButtonsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ADE26E32803837C00634B6C /* ExampleButtonsViewController.swift */; };
84+
4ADE26E7280383DC00634B6C /* ButtonClickStyle+Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ADE26E6280383DC00634B6C /* ButtonClickStyle+Buttons.swift */; };
8285
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
8386
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
8487
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
@@ -162,6 +165,9 @@
162165
4A62F3572803115C00534ABA /* ButtonLayerExampleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonLayerExampleView.swift; sourceTree = "<group>"; };
163166
4A62F3582803115C00534ABA /* ButtonLayerExampleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ButtonLayerExampleView.xib; sourceTree = "<group>"; };
164167
4A62F3B82803122700534ABA /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
168+
4ADE26E22803837C00634B6C /* ExampleButtonsViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = ExampleButtonsViewController.storyboard; sourceTree = "<group>"; };
169+
4ADE26E32803837C00634B6C /* ExampleButtonsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleButtonsViewController.swift; sourceTree = "<group>"; };
170+
4ADE26E6280383DC00634B6C /* ButtonClickStyle+Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ButtonClickStyle+Buttons.swift"; sourceTree = "<group>"; };
165171
4F15AAFA673DA24A3C49A947 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
166172
585C1A339472B772504181DB /* Pods_ButtonClickStyle_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ButtonClickStyle_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
167173
607FACD01AFB9204008FA782 /* ButtonClickStyle_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ButtonClickStyle_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -200,24 +206,16 @@
200206
4A14CBC22803437C00DA8A68 /* ButtonClickStyle */ = {
201207
isa = PBXGroup;
202208
children = (
209+
4A14CBCF2803437C00DA8A68 /* Animations */,
203210
4A62F30B2803115C00534ABA /* Utils */,
204-
4A14CBC32803437C00DA8A68 /* ButtonClick */,
211+
4A14CBC42803437C00DA8A68 /* Style */,
205212
4A14CBCE2803437C00DA8A68 /* ButtonClickStyleAddViewsAnimation.swift */,
206-
4A14CBCF2803437C00DA8A68 /* Animations */,
207213
4A14CBDA2803437C00DA8A68 /* ButtonClickStyleView.swift */,
208-
);
209-
path = ButtonClickStyle;
210-
sourceTree = "<group>";
211-
};
212-
4A14CBC32803437C00DA8A68 /* ButtonClick */ = {
213-
isa = PBXGroup;
214-
children = (
215-
4A14CBC42803437C00DA8A68 /* Style */,
216-
4A14CBCA2803437C00DA8A68 /* State */,
214+
4A14CBCB2803437C00DA8A68 /* ButtonClickState.swift */,
217215
4A14CBCC2803437C00DA8A68 /* ButtonClick.swift */,
218216
4A14CBCD2803437C00DA8A68 /* ButtonClicClosure.swift */,
219217
);
220-
path = ButtonClick;
218+
path = ButtonClickStyle;
221219
sourceTree = "<group>";
222220
};
223221
4A14CBC42803437C00DA8A68 /* Style */ = {
@@ -232,14 +230,6 @@
232230
path = Style;
233231
sourceTree = "<group>";
234232
};
235-
4A14CBCA2803437C00DA8A68 /* State */ = {
236-
isa = PBXGroup;
237-
children = (
238-
4A14CBCB2803437C00DA8A68 /* ButtonClickState.swift */,
239-
);
240-
path = State;
241-
sourceTree = "<group>";
242-
};
243233
4A14CBCF2803437C00DA8A68 /* Animations */ = {
244234
isa = PBXGroup;
245235
children = (
@@ -326,6 +316,7 @@
326316
4A62F3412803115C00534ABA /* Neomorphism */,
327317
4A62F3442803115C00534ABA /* TestDemoGradient */,
328318
4A62F3472803115C00534ABA /* BtnView.swift */,
319+
4ADE26E6280383DC00634B6C /* ButtonClickStyle+Buttons.swift */,
329320
);
330321
path = Button;
331322
sourceTree = "<group>";
@@ -468,19 +459,20 @@
468459
4A62F3482803115C00534ABA /* Screen */ = {
469460
isa = PBXGroup;
470461
children = (
471-
4A62F3492803115C00534ABA /* ButtonList */,
472462
4A62F34C2803115C00534ABA /* Test */,
473463
4A62F34F2803115C00534ABA /* TestDemo */,
474-
4A62F3522803115C00534ABA /* ExampleAnimations */,
464+
4ADE26E12803837C00634B6C /* ExampleButtons */,
465+
4A62F3522803115C00534ABA /* ExampleClickStyleAnimations */,
466+
4A62F3492803115C00534ABA /* ButtonList */,
475467
);
476468
path = Screen;
477469
sourceTree = "<group>";
478470
};
479471
4A62F3492803115C00534ABA /* ButtonList */ = {
480472
isa = PBXGroup;
481473
children = (
482-
4A62F34A2803115C00534ABA /* ButtonListViewController.storyboard */,
483474
4A62F34B2803115C00534ABA /* ButtonListViewController.swift */,
475+
4A62F34A2803115C00534ABA /* ButtonListViewController.storyboard */,
484476
);
485477
path = ButtonList;
486478
sourceTree = "<group>";
@@ -497,19 +489,19 @@
497489
4A62F34F2803115C00534ABA /* TestDemo */ = {
498490
isa = PBXGroup;
499491
children = (
500-
4A62F3502803115C00534ABA /* TestDemoViewController.storyboard */,
501492
4A62F3512803115C00534ABA /* TestDemoViewController.swift */,
493+
4A62F3502803115C00534ABA /* TestDemoViewController.storyboard */,
502494
);
503495
path = TestDemo;
504496
sourceTree = "<group>";
505497
};
506-
4A62F3522803115C00534ABA /* ExampleAnimations */ = {
498+
4A62F3522803115C00534ABA /* ExampleClickStyleAnimations */ = {
507499
isa = PBXGroup;
508500
children = (
509-
4A62F3532803115C00534ABA /* ExampleAnimationsViewController.storyboard */,
510501
4A62F3542803115C00534ABA /* ExampleAnimationsViewController.swift */,
502+
4A62F3532803115C00534ABA /* ExampleAnimationsViewController.storyboard */,
511503
);
512-
path = ExampleAnimations;
504+
path = ExampleClickStyleAnimations;
513505
sourceTree = "<group>";
514506
};
515507
4A62F3552803115C00534ABA /* View */ = {
@@ -529,6 +521,15 @@
529521
path = ButtonLayerExample;
530522
sourceTree = "<group>";
531523
};
524+
4ADE26E12803837C00634B6C /* ExampleButtons */ = {
525+
isa = PBXGroup;
526+
children = (
527+
4ADE26E32803837C00634B6C /* ExampleButtonsViewController.swift */,
528+
4ADE26E22803837C00634B6C /* ExampleButtonsViewController.storyboard */,
529+
);
530+
path = ExampleButtons;
531+
sourceTree = "<group>";
532+
};
532533
607FACC71AFB9204008FA782 = {
533534
isa = PBXGroup;
534535
children = (
@@ -688,6 +689,7 @@
688689
4A62F3962803115C00534ABA /* NeomorphismButtonView.xib in Resources */,
689690
4A62F3852803115C00534ABA /* GoogleButtonView.xib in Resources */,
690691
4A62F3832803115C00534ABA /* TestDemoBlurButtonView.xib in Resources */,
692+
4ADE26E42803837C00634B6C /* ExampleButtonsViewController.storyboard in Resources */,
691693
4A62F37D2803115C00534ABA /* BuyNowButtonView.xib in Resources */,
692694
4A62F39A2803115C00534ABA /* ButtonListViewController.storyboard in Resources */,
693695
);
@@ -753,6 +755,7 @@
753755
4A62F3732803115C00534ABA /* DesignableView.swift in Sources */,
754756
4A62F3A22803115C00534ABA /* ButtonLayerExampleView.swift in Sources */,
755757
4A62F3762803115C00534ABA /* XibView.swift in Sources */,
758+
4ADE26E52803837C00634B6C /* ExampleButtonsViewController.swift in Sources */,
756759
4A62F3822803115C00534ABA /* DeleteButtonView.swift in Sources */,
757760
4A14CBEA2803437C00DA8A68 /* UIView+AnimationColorFlat.swift in Sources */,
758761
4A14CBEC2803437C00DA8A68 /* UIView+AnimationFlash.swift in Sources */,
@@ -761,6 +764,7 @@
761764
4A14CBE02803437C00DA8A68 /* ButtonClickState.swift in Sources */,
762765
4A62F37A2803115C00534ABA /* UIView+Positions.swift in Sources */,
763766
4A62F39B2803115C00534ABA /* ButtonListViewController.swift in Sources */,
767+
4ADE26E7280383DC00634B6C /* ButtonClickStyle+Buttons.swift in Sources */,
764768
4A14CBDE2803437C00DA8A68 /* ButtonClickStyleEmoji.swift in Sources */,
765769
4A62F3992803115C00534ABA /* BtnView.swift in Sources */,
766770
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,

Example/ButtonClickStyle/Base.lproj/Main.storyboard

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<!--View Controller-->
2929
<scene sceneID="tne-QT-ifu">
3030
<objects>
31-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="ButtonClickStyle" customModuleProvider="target" sceneMemberID="viewController">
31+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="ButtonClickStyle_Example" customModuleProvider="target" sceneMemberID="viewController">
3232
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
3333
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
3434
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -52,23 +52,32 @@
5252
</connections>
5353
</button>
5454
<button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bw3-He-sJB">
55-
<rect key="frame" x="105" y="224" width="204" height="30"/>
55+
<rect key="frame" x="98.5" y="224" width="217" height="30"/>
5656
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
5757
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
58-
<state key="normal" title="ExampleAnimations Screen "/>
58+
<state key="normal" title="Click Style Anim. List Screen "/>
5959
<connections>
6060
<action selector="exampleAnimationsScreenButtonAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="XTw-b2-Irj"/>
6161
</connections>
6262
</button>
6363
<button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="753" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mXW-y9-Vhi">
64-
<rect key="frame" x="141" y="262" width="132" height="30"/>
64+
<rect key="frame" x="141" y="304" width="132" height="30"/>
6565
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
6666
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
6767
<state key="normal" title="ButtonList Screen"/>
6868
<connections>
6969
<action selector="buttonListScreenButtonAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="i30-fC-Jkb"/>
7070
</connections>
7171
</button>
72+
<button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="18u-xo-eAM">
73+
<rect key="frame" x="131.5" y="264" width="151" height="30"/>
74+
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
75+
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
76+
<state key="normal" title="Buttons List Screen "/>
77+
<connections>
78+
<action selector="exampleButtonsScreenButtonAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="blv-iq-0CV"/>
79+
</connections>
80+
</button>
7281
</subviews>
7382
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
7483
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -77,9 +86,11 @@
7786
<constraint firstItem="mXW-y9-Vhi" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="6gz-Es-SwW"/>
7887
<constraint firstItem="qXM-rs-wzT" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="146" id="EwE-0I-jHL"/>
7988
<constraint firstItem="Bw3-He-sJB" firstAttribute="top" secondItem="U4i-jN-1m6" secondAttribute="bottom" constant="10" id="J5M-I6-KR6"/>
80-
<constraint firstItem="mXW-y9-Vhi" firstAttribute="top" secondItem="Bw3-He-sJB" secondAttribute="bottom" constant="8" symbolic="YES" id="NHz-z8-mid"/>
89+
<constraint firstItem="mXW-y9-Vhi" firstAttribute="top" secondItem="Bw3-He-sJB" secondAttribute="bottom" constant="50" id="NHz-z8-mid"/>
8190
<constraint firstItem="Bw3-He-sJB" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="NQG-Ih-XNE"/>
8291
<constraint firstItem="qXM-rs-wzT" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="56" id="OBx-lA-c9u"/>
92+
<constraint firstItem="18u-xo-eAM" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="UZ5-LE-85j"/>
93+
<constraint firstItem="18u-xo-eAM" firstAttribute="top" secondItem="Bw3-He-sJB" secondAttribute="bottom" constant="10" id="ekk-cC-Zdk"/>
8394
<constraint firstItem="qXM-rs-wzT" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="moj-pA-DX3"/>
8495
<constraint firstItem="Bw3-He-sJB" firstAttribute="top" secondItem="U4i-jN-1m6" secondAttribute="bottom" constant="10" id="yo9-iw-cSf"/>
8596
<constraint firstItem="qXM-rs-wzT" firstAttribute="centerX" secondItem="U4i-jN-1m6" secondAttribute="centerX" id="zg8-Lb-G5U"/>

Example/ButtonClickStyle/UI/Button/Blue/BlueButtonView.xib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
1010
<objects>
11-
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BlueButtonView" customModule="ButtonCustomClickStyle" customModuleProvider="target">
11+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BlueButtonView" customModule="ButtonClickStyle_Example" customModuleProvider="target">
1212
<connections>
1313
<outlet property="mainView" destination="nKK-Ra-1y6" id="FAi-tw-OgA"/>
1414
<outlet property="titleLabel" destination="nZy-Nz-A6n" id="UUo-U0-6lp"/>
@@ -19,7 +19,7 @@
1919
<rect key="frame" x="0.0" y="0.0" width="202" height="93"/>
2020
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2121
<subviews>
22-
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nKK-Ra-1y6" userLabel="Button 3" customClass="DesignableView" customModule="ButtonCustomClickStyle" customModuleProvider="target">
22+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nKK-Ra-1y6" userLabel="Button 3" customClass="DesignableView" customModule="ButtonClickStyle_Example" customModuleProvider="target">
2323
<rect key="frame" x="28" y="22" width="146" height="49"/>
2424
<subviews>
2525
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Buy now" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="100" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nZy-Nz-A6n" userLabel="Buy now">
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
//
2+
// ButtonClickStyle+Buttons.swift
3+
// ButtonClickStyle_Example
4+
//
5+
// Created by Рустам Мотыгуллин on 11.04.2022.
6+
// Copyright © 2022 CocoaPods. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
extension ButtonClick {
12+
13+
//MARK: - Style
14+
15+
public enum Buttons: String, CaseIterable {
16+
case JustPink
17+
case NoShadow
18+
case Blue
19+
case BuyNow
20+
case Download
21+
case Delete
22+
case Search
23+
case Subscribe
24+
case Firefox
25+
case Google
26+
case GrButton
27+
case Neomorphism
28+
case TestButton
29+
case Green
30+
case TestRandom
31+
case Test3Squares
32+
33+
public static var allName: [String] = ButtonClick.Buttons.allCases.map { $0.rawValue }
34+
public static var allCases: [ButtonClick.Buttons] = [
35+
.JustPink,
36+
.NoShadow,
37+
.Blue,
38+
.BuyNow,
39+
.Download,
40+
.Delete,
41+
.Search,
42+
.Subscribe,
43+
.Firefox,
44+
.Google,
45+
.GrButton,
46+
.Neomorphism,
47+
.TestButton,
48+
.Green,
49+
.TestRandom,
50+
.Test3Squares
51+
]
52+
53+
public static var shortNames: [String] = ButtonClick.Buttons.allCases.map { $0.rawValue }
54+
public static var shortCases: [ButtonClick.Buttons] = [
55+
.JustPink,
56+
.NoShadow,
57+
.Blue,
58+
.BuyNow,
59+
.Download,
60+
.Delete,
61+
.Search,
62+
.Subscribe,
63+
.Firefox,
64+
.Google,
65+
.GrButton,
66+
.Neomorphism,
67+
.TestButton,
68+
.Green,
69+
]
70+
}
71+
}
72+
73+
74+

Example/ButtonClickStyle/UI/Button/Firefox/FirefoxButtonView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FirefoxButtonView: BtnView {
2121
addViews = [gradientView]
2222
} else if type == ButtonClick._Style.androidClickable.rawValue ||
2323
type == ButtonClick._Style.androidClickableDark.rawValue {
24-
addViews = nil
24+
addViews = [gradientView]
2525
} else {
2626
addViews = [mainView]
2727
}

Example/ButtonClickStyle/UI/Button/JustPink/JustPinkButtonView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class JustPinkButtonView: BtnView {
1212
@IBOutlet var gradientView: DesignableView!
1313
@IBOutlet var titleLabel: UILabel!
1414

15+
1516
// MARK: Initialize
1617

1718
override func fill(state: ButtonClick.State?) {
@@ -23,6 +24,11 @@ class JustPinkButtonView: BtnView {
2324
var views: [UIView]? = []
2425

2526

27+
if !state.addBackgrondColor {
28+
backgroundColor = .clear
29+
}
30+
fillView.isHidden = !state.addBackgrondColor
31+
2632
if state.new {
2733
let color: UIColor = #colorLiteral(red: 0.568627451, green: 0.2784313725, blue: 1, alpha: 1)
2834
fillView.fillColor = #colorLiteral(red: 0.1529411765, green: 0.6823529412, blue: 0.3764705882, alpha: 1).withAlphaComponent(0.08)

0 commit comments

Comments
 (0)