File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Example/Example/Base.lproj Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?>
2- <document type =" com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version =" 3.0" toolsVersion =" 7706 " systemVersion =" 14D136 " 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 =" 9532 " systemVersion =" 15B42 " targetRuntime =" iOS.CocoaTouch" propertyAccessControl =" none" useAutolayout =" YES" useTraitCollections =" YES" initialViewController =" vXZ-lx-hvc" >
33 <dependencies >
4- <plugIn identifier =" com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version =" 7703" />
4+ <deployment identifier =" iOS" />
5+ <plugIn identifier =" com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version =" 9530" />
56 </dependencies >
67 <scenes >
78 <!-- View Controller-->
5455 <action selector =" didTapButton:" destination =" vXZ-lx-hvc" eventType =" touchUpInside" id =" FxP-wM-8Bq" />
5556 </connections >
5657 </view >
57- <view tag =" 4 " contentMode =" scaleToFill" translatesAutoresizingMaskIntoConstraints =" NO" id =" QB4-xJ-cL5" customClass =" KYShutterButton" customModule =" Example" customModuleProvider =" target" >
58+ <view tag =" 3 " contentMode =" scaleToFill" translatesAutoresizingMaskIntoConstraints =" NO" id =" QB4-xJ-cL5" customClass =" KYShutterButton" customModule =" Example" customModuleProvider =" target" >
5859 <rect key =" frame" x =" 327" y =" 341" width =" 66" height =" 66" />
5960 <color key =" backgroundColor" white =" 0.0" alpha =" 0.0" colorSpace =" calibratedWhite" />
6061 <constraints >
6869 <userDefinedRuntimeAttribute type =" color" keyPath =" buttonColor" >
6970 <color key =" value" red =" 1" green =" 0.0" blue =" 0.0" alpha =" 1" colorSpace =" calibratedRGB" />
7071 </userDefinedRuntimeAttribute >
72+ <userDefinedRuntimeAttribute type =" number" keyPath =" rotateAnimateDuration" >
73+ <real key =" value" value =" 0.10000000000000001" />
74+ </userDefinedRuntimeAttribute >
7175 </userDefinedRuntimeAttributes >
7276 <connections >
7377 <action selector =" didTapButton:" destination =" vXZ-lx-hvc" eventType =" touchUpInside" id =" JmT-BP-jlX" />
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = "KYShutterButton"
3- s . version = "1.0.2 "
3+ s . version = "1.0.3 "
44 s . summary = "KYShutterButton is a custom button that is similar to the shutter button of the camera app"
55 s . homepage = "https://github.com/ykyouhei/KYShutterButton"
66 s . license = "MIT"
Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ public class KYShutterButton: UIButton {
7777 }
7878 }
7979
80+ @objc
81+ @IBInspectable public var rotateAnimateDuration : Float = 5 {
82+ didSet {
83+ _recordingRotateAnimation. duration = NSTimeInterval ( rotateAnimateDuration)
84+ _recordingAnimation. duration = NSTimeInterval ( rotateAnimateDuration*2)
85+ }
86+ }
87+
8088 @objc
8189 public var buttonState : ButtonState = . Normal {
8290 didSet {
@@ -232,7 +240,7 @@ public class KYShutterButton: UIButton {
232240 paths. append ( self . p_arcPathWithProgress ( animationProgress, clockwise: false ) . CGPath)
233241 }
234242 let animation = CAKeyframeAnimation ( keyPath: " path " )
235- animation. duration = 10
243+ animation. duration = NSTimeInterval ( rotateAnimateDuration*2 )
236244 animation. values = paths
237245 animation. beginTime = CACurrentMediaTime ( ) + _kstartAnimateDuration
238246 animation. repeatCount = Float . infinity
@@ -244,7 +252,7 @@ public class KYShutterButton: UIButton {
244252 let animation = CABasicAnimation ( keyPath: " transform.rotation " )
245253 animation. fromValue = 0
246254 animation. toValue = CGFloat ( M_PI*2 . 0 )
247- animation. duration = 5
255+ animation. duration = NSTimeInterval ( rotateAnimateDuration )
248256 animation. repeatCount = Float . infinity
249257 animation. beginTime = CACurrentMediaTime ( ) + _kstartAnimateDuration
250258 return animation
You can’t perform that action at this time.
0 commit comments