Skip to content

Commit 0d73dd1

Browse files
committed
update readme and demo launch screen
1 parent 952791e commit 0d73dd1

File tree

11 files changed

+99
-37
lines changed

11 files changed

+99
-37
lines changed

Classes/ZFRippleButton.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,12 @@ class ZFRippleButton: UIButton {
147147
animateToNormal()
148148
}
149149

150-
private func animateToNormal(){
150+
private func animateToNormal() {
151151
UIView.animateWithDuration(0.1,
152152
animations: {
153153
self.rippleBackgroundView.alpha = 1
154154
},
155155
completion: {(success: Bool) -> () in
156-
// Fast Touch Up Response: Original animation time is 0.6. Too long animation interval causes slow response to fast consecutive button press!
157156
UIView.animateWithDuration(self.touchUpAnimationTime,
158157
animations: {
159158
self.rippleBackgroundView.alpha = 0

Demo/ZFRippleButtonDemo/ZFRippleButtonDemo.xcodeproj/project.pbxproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
DC346CC4195F150E0099F81E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC346CC3195F150E0099F81E /* Images.xcassets */; };
1414
DC346CD0195F150E0099F81E /* ZFRippleButtonDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC346CCF195F150E0099F81E /* ZFRippleButtonDemoTests.swift */; };
1515
DC346CDB195F157D0099F81E /* ZFRippleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC346CDA195F157D0099F81E /* ZFRippleButton.swift */; };
16+
DCD98C8B1BCA45340006FF8F /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DCD98C891BCA45340006FF8F /* Launch Screen.storyboard */; settings = {ASSET_TAGS = (); }; };
1617
/* End PBXBuildFile section */
1718

1819
/* Begin PBXContainerItemProxy section */
@@ -36,6 +37,7 @@
3637
DC346CCE195F150E0099F81E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3738
DC346CCF195F150E0099F81E /* ZFRippleButtonDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZFRippleButtonDemoTests.swift; sourceTree = "<group>"; };
3839
DC346CDA195F157D0099F81E /* ZFRippleButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ZFRippleButton.swift; path = ../../../Classes/ZFRippleButton.swift; sourceTree = "<group>"; };
40+
DCD98C8A1BCA45340006FF8F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = "Base.lproj/Launch Screen.storyboard"; sourceTree = "<group>"; };
3941
/* End PBXFileReference section */
4042

4143
/* Begin PBXFrameworksBuildPhase section */
@@ -83,6 +85,7 @@
8385
DC346CC0195F150E0099F81E /* Main.storyboard */,
8486
DC346CC3195F150E0099F81E /* Images.xcassets */,
8587
DC346CBA195F150E0099F81E /* Supporting Files */,
88+
DCD98C891BCA45340006FF8F /* Launch Screen.storyboard */,
8689
);
8790
path = ZFRippleButtonDemo;
8891
sourceTree = "<group>";
@@ -202,6 +205,7 @@
202205
isa = PBXResourcesBuildPhase;
203206
buildActionMask = 2147483647;
204207
files = (
208+
DCD98C8B1BCA45340006FF8F /* Launch Screen.storyboard in Resources */,
205209
DC346CC2195F150E0099F81E /* Main.storyboard in Resources */,
206210
DC346CC4195F150E0099F81E /* Images.xcassets in Resources */,
207211
);
@@ -254,6 +258,14 @@
254258
name = Main.storyboard;
255259
sourceTree = "<group>";
256260
};
261+
DCD98C891BCA45340006FF8F /* Launch Screen.storyboard */ = {
262+
isa = PBXVariantGroup;
263+
children = (
264+
DCD98C8A1BCA45340006FF8F /* Base */,
265+
);
266+
name = "Launch Screen.storyboard";
267+
sourceTree = "<group>";
268+
};
257269
/* End PBXVariantGroup section */
258270

259271
/* Begin XCBuildConfiguration section */
@@ -338,7 +350,6 @@
338350
isa = XCBuildConfiguration;
339351
buildSettings = {
340352
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
341-
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
342353
INFOPLIST_FILE = ZFRippleButtonDemo/Info.plist;
343354
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
344355
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -350,7 +361,6 @@
350361
isa = XCBuildConfiguration;
351362
buildSettings = {
352363
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
353-
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
354364
INFOPLIST_FILE = ZFRippleButtonDemo/Info.plist;
355365
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
356366
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
6+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="EHf-IW-A2E">
11+
<objects>
12+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+
<layoutGuides>
14+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
15+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
16+
</layoutGuides>
17+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
18+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
19+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20+
<subviews>
21+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2558 zoonref. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
22+
<rect key="frame" x="20" y="559" width="560" height="21"/>
23+
<animations/>
24+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
25+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
26+
<nil key="highlightedColor"/>
27+
</label>
28+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ZFRippleButtonDemo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
29+
<rect key="frame" x="20" y="180" width="560" height="43"/>
30+
<animations/>
31+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
32+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
33+
<nil key="highlightedColor"/>
34+
</label>
35+
</subviews>
36+
<animations/>
37+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
38+
<constraints>
39+
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
40+
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
41+
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
42+
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
43+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
44+
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
45+
</constraints>
46+
</view>
47+
</viewController>
48+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
49+
</objects>
50+
<point key="canvasLocation" x="53" y="375"/>
51+
</scene>
52+
</scenes>
53+
</document>

Demo/ZFRippleButtonDemo/ZFRippleButtonDemo/Base.lproj/Main.storyboard

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7531" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
66
</dependencies>
77
<scenes>
88
<!--View Controller-->
@@ -19,6 +19,7 @@
1919
<subviews>
2020
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sYH-iL-GfQ" customClass="ZFRippleButton" customModule="ZFRippleButtonDemo" customModuleProvider="target">
2121
<rect key="frame" x="246" y="145" width="109" height="30"/>
22+
<animations/>
2223
<constraints>
2324
<constraint firstAttribute="height" constant="30" id="4YK-bf-jV4"/>
2425
<constraint firstAttribute="width" constant="109" id="pDm-J0-L65"/>
@@ -31,6 +32,7 @@
3132
</button>
3233
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vzG-8X-6pK" customClass="ZFRippleButton" customModule="ZFRippleButtonDemo" customModuleProvider="target">
3334
<rect key="frame" x="16" y="427" width="568" height="40"/>
35+
<animations/>
3436
<color key="backgroundColor" red="0.1843137255" green="0.52549019610000003" blue="0.92156862750000001" alpha="1" colorSpace="calibratedRGB"/>
3537
<constraints>
3638
<constraint firstAttribute="height" constant="40" id="2Te-o0-ssh"/>
@@ -55,6 +57,7 @@
5557
</button>
5658
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0hN-TT-axH" customClass="ZFRippleButton" customModule="ZFRippleButtonDemo" customModuleProvider="target">
5759
<rect key="frame" x="246" y="344" width="109" height="40"/>
60+
<animations/>
5861
<color key="backgroundColor" red="0.1843137255" green="0.52549019610000003" blue="0.92156862750000001" alpha="1" colorSpace="calibratedRGB"/>
5962
<constraints>
6063
<constraint firstAttribute="height" constant="40" id="PIZ-7G-bl9"/>
@@ -77,6 +80,7 @@
7780
</button>
7881
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BHL-2b-19F" customClass="ZFRippleButton" customModule="ZFRippleButtonDemo" customModuleProvider="target">
7982
<rect key="frame" x="246" y="244" width="109" height="40"/>
83+
<animations/>
8084
<color key="backgroundColor" red="0.18431372549019609" green="0.52549019607843139" blue="0.92156862745098034" alpha="1" colorSpace="calibratedRGB"/>
8185
<constraints>
8286
<constraint firstAttribute="width" constant="109" id="XDu-wd-a2d"/>
@@ -98,6 +102,7 @@
98102
</button>
99103
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Ty-8G-uWA" customClass="ZFRippleButton" customModule="ZFRippleButtonDemo" customModuleProvider="target">
100104
<rect key="frame" x="246" y="55" width="109" height="30"/>
105+
<animations/>
101106
<constraints>
102107
<constraint firstAttribute="height" constant="30" id="RlJ-Ph-RwX"/>
103108
<constraint firstAttribute="width" constant="109" id="dJC-jH-mXS"/>
@@ -115,6 +120,7 @@
115120
</userDefinedRuntimeAttributes>
116121
</button>
117122
</subviews>
123+
<animations/>
118124
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
119125
<constraints>
120126
<constraint firstItem="sYH-iL-GfQ" firstAttribute="top" secondItem="5Ty-8G-uWA" secondAttribute="bottom" constant="60" id="2m8-rD-4bB"/>

Demo/ZFRippleButtonDemo/ZFRippleButtonDemo/Images.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,30 @@
55
"size" : "29x29",
66
"scale" : "2x"
77
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "29x29",
11+
"scale" : "3x"
12+
},
813
{
914
"idiom" : "iphone",
1015
"size" : "40x40",
1116
"scale" : "2x"
1217
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "40x40",
21+
"scale" : "3x"
22+
},
1323
{
1424
"idiom" : "iphone",
1525
"size" : "60x60",
1626
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "60x60",
31+
"scale" : "3x"
1732
}
1833
],
1934
"info" : {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

Demo/ZFRippleButtonDemo/ZFRippleButtonDemo/Images.xcassets/LaunchImage.launchimage/Contents.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

Demo/ZFRippleButtonDemo/ZFRippleButtonDemo/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<string>1</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>Launch Screen</string>
2527
<key>UIMainStoryboardFile</key>
2628
<string>Main</string>
2729
<key>UIRequiredDeviceCapabilities</key>

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@ Set the UIButton class in Nib to ```ZFRippleButton``` or create it programmatica
2222

2323
<img src="Screenshot/shadow-button.gif"/>
2424

25-
and you can set the color of ripple using ```rippleColor``` and ```rippleBackgroundColor```
26-
27-
```touchUpAnimationTime``` is time interval of touch up animation. Default value is 0.6 second and causes slow response to fast consecutive button press as follows:
28-
29-
<img src="Screenshot/longer-touchup-animation-time.gif"/>
25+
```touchUpAnimationTime``` is time interval of touch up animation
3026

31-
Shorten this value (the following is 0.1 second) to make the response fast.
32-
33-
<img src="Screenshot/shorter-touchup-animation-time.gif"/>
27+
and you can set the color of ripple using ```rippleColor``` and ```rippleBackgroundColor```
3428

3529
## Requirements
3630
- iOS >= 7.0
-65.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)