From 9e28c7f2d0f9d4bd3ee71f13d7392aaa2323029e Mon Sep 17 00:00:00 2001 From: jangwonhee Date: Mon, 18 Apr 2016 15:58:50 +0900 Subject: [PATCH 1/4] sync --- Classes/WobbleView.swift | 110 ++++++++++----------- Example/.DS_Store | Bin 0 -> 6148 bytes Example/Example.xcodeproj/project.pbxproj | 6 +- Example/Example/Base.lproj/Main.storyboard | 6 +- 4 files changed, 57 insertions(+), 65 deletions(-) create mode 100644 Example/.DS_Store diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index 98c2f52..2ed4851 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -9,23 +9,32 @@ import UIKit import QuartzCore -public class WobbleView: UIView { +public class WobbleView: UIView, WobbleDelegate { + //on, off + public var on:Bool { + get { + return (layer as! WobbleLayer).on + } + set(data) { + (layer as! WobbleLayer).on = data + } + } /* - The frequency of oscillation for the wobble behavior. - */ + The frequency of oscillation for the wobble behavior. + */ @IBInspectable public var frequency: CGFloat = 3 /* - The amount of damping to apply to the wobble behavior. - */ + The amount of damping to apply to the wobble behavior. + */ @IBInspectable public var damping: CGFloat = 0.3 /* - A bitmask value that identifies the edges that you want to wobble. - You can use this parameter to wobble only a subset of the edges of the rectangle. - */ - @IBInspectable public var edges: ViewEdge = .Right + A bitmask value that identifies the edges that you want to wobble. + You can use this parameter to wobble only a subset of the edges of the rectangle. + */ + @IBInspectable public var edges: ViewEdge = ViewEdge.All // MARK: init required public init?(coder aDecoder: NSCoder) { @@ -53,35 +62,14 @@ public class WobbleView: UIView { setUpDisplayLink() } - public func reset() { - - setUpMidpoints() - setUpCenters() - setUpBehaviours() - - if vertexViews[0].layer.presentationLayer() != nil { - - let bezierPath = UIBezierPath() - bezierPath.moveToPoint(vertexViews[0].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.addLineToPoint(vertexViews[1].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.addLineToPoint(vertexViews[2].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.addLineToPoint(vertexViews[3].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.closePath() - - maskLayer.path = bezierPath.CGPath - (layer as! CAShapeLayer).path = bezierPath.CGPath - layer.mask = maskLayer - } - } - private func setUpVertices() { vertexViews = [] let verticesOrigins = [CGPoint(x: frame.origin.x, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), - CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), + CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] createAdditionalViews(&vertexViews, origins: verticesOrigins) } @@ -91,9 +79,9 @@ public class WobbleView: UIView { midpointViews = [] let midpointsOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height), - CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height/2)] + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height), + CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height/2)] createAdditionalViews(&midpointViews, origins: midpointsOrigins) } @@ -102,12 +90,12 @@ public class WobbleView: UIView { centerViews = [] - let radius = min(frame.size.width/2, frame.size.height/2) + var radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), - CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), - CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] + CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), + CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] createAdditionalViews(¢erViews, origins: centersOrigins) } @@ -149,10 +137,10 @@ public class WobbleView: UIView { var bezierPath = UIBezierPath() bezierPath.moveToPoint(vertexViews[0].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - addEdge(&bezierPath, formerVertex: 0, latterVertex: 1, curved: edges.intersect(.Top)) - addEdge(&bezierPath, formerVertex: 1, latterVertex: 2, curved: edges.intersect(.Right)) - addEdge(&bezierPath, formerVertex: 2, latterVertex: 3, curved: edges.intersect(.Bottom)) - addEdge(&bezierPath, formerVertex: 3, latterVertex: 0, curved: edges.intersect(.Left)) + addEdge(&bezierPath, formerVertex: 0, latterVertex: 1, curved: ViewEdge(rawValue: edges.rawValue & ViewEdge.Top.rawValue)) + addEdge(&bezierPath, formerVertex: 1, latterVertex: 2, curved: ViewEdge(rawValue: edges.rawValue & ViewEdge.Right.rawValue)) + addEdge(&bezierPath, formerVertex: 2, latterVertex: 3, curved: ViewEdge(rawValue: edges.rawValue & ViewEdge.Bottom.rawValue)) + addEdge(&bezierPath, formerVertex: 3, latterVertex: 0, curved: ViewEdge(rawValue: edges.rawValue & ViewEdge.Left.rawValue)) bezierPath.closePath() maskLayer.path = bezierPath.CGPath @@ -176,7 +164,7 @@ public class WobbleView: UIView { for origin in origins { - let view = UIView(frame: CGRect(origin: origin, size: CGSize(width: 1, height: 1))) + var view = UIView(frame: CGRect(origin: origin, size: CGSize(width: 1, height: 1))) view.backgroundColor = UIColor.clearColor() addSubview(view) @@ -186,7 +174,7 @@ public class WobbleView: UIView { private func createAttachmentBehaviour(inout behaviours: [VertexAttachmentBehaviour], view: UIView, vertexIndex: Int) { - let attachmentBehaviour = VertexAttachmentBehaviour(item: view, attachedToAnchor: vertexViews[vertexIndex].frame.origin) + var attachmentBehaviour = VertexAttachmentBehaviour(item: view, attachedToAnchor: vertexViews[vertexIndex].frame.origin) attachmentBehaviour.damping = damping attachmentBehaviour.frequency = frequency attachmentBehaviour.vertexIndex = vertexIndex @@ -198,16 +186,15 @@ public class WobbleView: UIView { private func addEdge(inout bezierPath: UIBezierPath, formerVertex: Int, latterVertex: Int, curved: ViewEdge) { if (curved) { - - let controlPoint = (vertexViews[formerVertex].layer.presentationLayer()!.frame.origin - (midpointViews[formerVertex].layer.presentationLayer()!.frame.origin - vertexViews[latterVertex].layer.presentationLayer()!.frame.origin)) - layer.presentationLayer()!.frame.origin + var controlPoint = ((vertexViews[formerVertex].layer.presentationLayer()?.frame.origin)! - ((midpointViews[formerVertex].layer.presentationLayer()?.frame.origin)! - (vertexViews[latterVertex].layer.presentationLayer()?.frame.origin)!)) - (layer.presentationLayer()?.frame.origin)! bezierPath.addQuadCurveToPoint(vertexViews[latterVertex].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin, - controlPoint: controlPoint) + controlPoint: controlPoint) return; } - bezierPath.addLineToPoint(vertexViews[latterVertex].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) + bezierPath.addLineToPoint((vertexViews[latterVertex].layer.presentationLayer()?.frame.origin)! - (layer.presentationLayer()?.frame.origin)!) } // MARK: private variables @@ -241,27 +228,27 @@ extension WobbleView: UIDynamicAnimatorDelegate { } // MARK: WobbleDelegate -extension WobbleView: WobbleDelegate { +extension WobbleView { func positionChanged() { displayLink!.paused = false let verticesOrigins = [CGPoint(x: frame.origin.x, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), - CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), + CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] - for (i, vertexView) in vertexViews.enumerate() { + for (i, vertexView) in vertexViews.enumerate() { vertexView.frame.origin = verticesOrigins[i] } - let radius = min(frame.size.width/2, frame.size.height/2) + var radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), - CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), - CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] + CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), + CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] for (i, centerView) in centerViews.enumerate() { centerView.frame.origin = centersOrigins[i] @@ -286,12 +273,15 @@ private protocol WobbleDelegate { } private class WobbleLayer: CAShapeLayer { + var on:Bool = false var wobbleDelegate: WobbleDelegate? @objc override var position: CGPoint { didSet { - wobbleDelegate?.positionChanged() + if on { + wobbleDelegate?.positionChanged() + } } } } diff --git a/Example/.DS_Store b/Example/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8cb3beece7de34c8403f8bba0469888d3e2d6add GIT binary patch literal 6148 zcmeHK!Ab)$5PhRP6ueYV9`gl4FJ5{HW%~vF0i`R7blF8LdfdGzR8TzrF$qI zL}UgsZ#J1pCJ#2r0FdRbo&z%gQ#M6WV??xjbm+vLCqyZ8blBn!S9rx{WTL;=rMaJD z#f)#!U_bvBHTTlt2`wJC_w)6pZ93b+%iD2LO=A1NC0sZLK9V zCOKxu-jE{{u~4FgikBE-;p|WDmmPaU3x{~|A-?ig@gik)&Yy}qBpZef27-Yh1E=;m z)BAtLUuLw(ABMzNFc1ves75p*?s6@I%j$%Q9%= bNp1RN$KFt9(f$%njE6uWBvdf)3k-Y$Di=7q literal 0 HcmV?d00001 diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index c20a161..7633640 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -272,8 +272,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + EMBEDDED_CONTENT_CONTAINS_SWIFT = NO; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.infullmobile.ui.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -285,8 +286,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + EMBEDDED_CONTENT_CONTAINS_SWIFT = NO; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.infullmobile.ui.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Example/Example/Base.lproj/Main.storyboard b/Example/Example/Base.lproj/Main.storyboard index f5f3e2c..1623896 100644 --- a/Example/Example/Base.lproj/Main.storyboard +++ b/Example/Example/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -27,7 +27,7 @@ - + From dfdacff234a231d44e637ccd1650fe61bfb3ca5b Mon Sep 17 00:00:00 2001 From: devmario Date: Wed, 29 Jun 2016 01:31:48 +0900 Subject: [PATCH 2/4] Fixed #19 --- Classes/WobbleView.swift | 96 ++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 37 deletions(-) diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index 2ed4851..948f18c 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -10,15 +10,10 @@ import UIKit import QuartzCore public class WobbleView: UIView, WobbleDelegate { - //on, off - public var on:Bool { - get { - return (layer as! WobbleLayer).on - } - set(data) { - (layer as! WobbleLayer).on = data - } - } + /* + The enable of WoobleView + */ + @IBInspectable public var on: Bool = true /* The frequency of oscillation for the wobble behavior. @@ -34,7 +29,7 @@ public class WobbleView: UIView, WobbleDelegate { A bitmask value that identifies the edges that you want to wobble. You can use this parameter to wobble only a subset of the edges of the rectangle. */ - @IBInspectable public var edges: ViewEdge = ViewEdge.All + @IBInspectable public var edges: ViewEdge = .All // MARK: init required public init?(coder aDecoder: NSCoder) { @@ -62,14 +57,35 @@ public class WobbleView: UIView, WobbleDelegate { setUpDisplayLink() } + public func reset() { + + setUpMidpoints() + setUpCenters() + setUpBehaviours() + + if vertexViews[0].layer.presentationLayer() != nil { + + let bezierPath = UIBezierPath() + bezierPath.moveToPoint(vertexViews[0].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) + bezierPath.addLineToPoint(vertexViews[1].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) + bezierPath.addLineToPoint(vertexViews[2].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) + bezierPath.addLineToPoint(vertexViews[3].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) + bezierPath.closePath() + + maskLayer.path = bezierPath.CGPath + (layer as! CAShapeLayer).path = bezierPath.CGPath + layer.mask = maskLayer + } + } + private func setUpVertices() { vertexViews = [] let verticesOrigins = [CGPoint(x: frame.origin.x, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), - CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), + CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] createAdditionalViews(&vertexViews, origins: verticesOrigins) } @@ -79,9 +95,9 @@ public class WobbleView: UIView, WobbleDelegate { midpointViews = [] let midpointsOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height), - CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height/2)] + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height), + CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height/2)] createAdditionalViews(&midpointViews, origins: midpointsOrigins) } @@ -90,12 +106,12 @@ public class WobbleView: UIView, WobbleDelegate { centerViews = [] - var radius = min(frame.size.width/2, frame.size.height/2) + let radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), - CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), - CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] + CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), + CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] createAdditionalViews(¢erViews, origins: centersOrigins) } @@ -164,7 +180,7 @@ public class WobbleView: UIView, WobbleDelegate { for origin in origins { - var view = UIView(frame: CGRect(origin: origin, size: CGSize(width: 1, height: 1))) + let view = UIView(frame: CGRect(origin: origin, size: CGSize(width: 1, height: 1))) view.backgroundColor = UIColor.clearColor() addSubview(view) @@ -174,7 +190,7 @@ public class WobbleView: UIView, WobbleDelegate { private func createAttachmentBehaviour(inout behaviours: [VertexAttachmentBehaviour], view: UIView, vertexIndex: Int) { - var attachmentBehaviour = VertexAttachmentBehaviour(item: view, attachedToAnchor: vertexViews[vertexIndex].frame.origin) + let attachmentBehaviour = VertexAttachmentBehaviour(item: view, attachedToAnchor: vertexViews[vertexIndex].frame.origin) attachmentBehaviour.damping = damping attachmentBehaviour.frequency = frequency attachmentBehaviour.vertexIndex = vertexIndex @@ -227,17 +243,20 @@ extension WobbleView: UIDynamicAnimatorDelegate { } } -// MARK: WobbleDelegate +// MARK: Extension extension WobbleView { + func isOn() -> Bool { + return self.on + } func positionChanged() { displayLink!.paused = false let verticesOrigins = [CGPoint(x: frame.origin.x, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), - CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), - CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), + CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), + CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] for (i, vertexView) in vertexViews.enumerate() { vertexView.frame.origin = verticesOrigins[i] @@ -246,9 +265,9 @@ extension WobbleView { var radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), - CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), - CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] + CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), + CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] for (i, centerView) in centerViews.enumerate() { centerView.frame.origin = centersOrigins[i] @@ -268,19 +287,15 @@ private class VertexAttachmentBehaviour: UIAttachmentBehavior { var vertexIndex: Int? } -private protocol WobbleDelegate { - func positionChanged() -} - private class WobbleLayer: CAShapeLayer { - var on:Bool = false - var wobbleDelegate: WobbleDelegate? @objc override var position: CGPoint { didSet { - if on { - wobbleDelegate?.positionChanged() + if let delegate = wobbleDelegate { + if delegate.isOn() { + delegate.positionChanged() + } } } } @@ -331,4 +346,11 @@ public struct ViewEdge : OptionSetType, BooleanType { static public var All: ViewEdge { return self.init(rawValue: 0b1111) } +} + +// MARK: WoobbleDelegate + +private protocol WobbleDelegate { + func isOn() -> Bool + func positionChanged() } \ No newline at end of file From 42a73654845c487aa5e9e405fcd56f4463af7211 Mon Sep 17 00:00:00 2001 From: devmario Date: Wed, 29 Jun 2016 01:34:18 +0900 Subject: [PATCH 3/4] Fixed #19 someone... --- Classes/WobbleView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index 948f18c..db320d4 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -262,7 +262,7 @@ extension WobbleView { vertexView.frame.origin = verticesOrigins[i] } - var radius = min(frame.size.width/2, frame.size.height/2) + let radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), From 1fbda4d7769d7352a36d4d1709be4d8f0f0a8171 Mon Sep 17 00:00:00 2001 From: devmario Date: Wed, 29 Jun 2016 01:37:13 +0900 Subject: [PATCH 4/4] fixed protocol --- Classes/WobbleView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index db320d4..9de76a6 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -9,7 +9,7 @@ import UIKit import QuartzCore -public class WobbleView: UIView, WobbleDelegate { +public class WobbleView: UIView { /* The enable of WoobleView */ @@ -244,7 +244,7 @@ extension WobbleView: UIDynamicAnimatorDelegate { } // MARK: Extension -extension WobbleView { +extension WobbleView: WobbleDelegate { func isOn() -> Bool { return self.on }