Skip to content

Commit

Permalink
added public words
Browse files Browse the repository at this point in the history
  • Loading branch information
0ber committed Feb 10, 2016
1 parent f960678 commit e6cdacf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions CircleMenuLib/CircleMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public func Init<Type>(value: Type, @noescape block: (object: Type) -> Void) ->

// MARK: Protocol

@objc protocol CircleMenuDelegate {
@objc public protocol CircleMenuDelegate {

// don't change button.tag
optional func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int)
Expand Down Expand Up @@ -65,7 +65,7 @@ public class CircleMenu: UIButton {
private var customSelectedIconView: UIImageView!

// MARK: life cicle
init(frame: CGRect,
public init(frame: CGRect,
normalIcon: String?,
selectedIcon: String?,
buttonsCount: Int = 3,
Expand Down Expand Up @@ -141,8 +141,8 @@ public class CircleMenu: UIButton {

let iconView = Init(UIImageView(image: image)) {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.contentMode = .Center
$0.userInteractionEnabled = false
$0.contentMode = .Center
$0.userInteractionEnabled = false
}
addSubview(iconView)

Expand Down Expand Up @@ -261,7 +261,7 @@ public class CircleMenu: UIButton {

let step: Float = 360.0 / Float(self.buttonsCount)
for index in 0..<self.buttonsCount {
let button = buttons[index]
let button = buttons[index]
let angle: Float = Float(index) * step
if isShow == true {
delegate?.circleMenu?(self, willDisplay: button, atIndex: index)
Expand Down
8 changes: 4 additions & 4 deletions CircleMenuLib/CircleMenuButton/CircleMenuButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public class CircleMenuButton: UIButton {
}

let container = Init(UIView(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: size))) {
$0.backgroundColor = UIColor.clearColor()
$0.backgroundColor = UIColor.clearColor()
$0.translatesAutoresizingMaskIntoConstraints = false
$0.layer.anchorPoint = CGPoint(x: 0.5, y: 1)
$0.layer.anchorPoint = CGPoint(x: 0.5, y: 1)
}
circleMenuSuperView.insertSubview(container, belowSubview: circleMenu)

Expand Down Expand Up @@ -234,8 +234,8 @@ extension UIView {
public func rotationLayerAnimation(view: UIView, angle: Float, duration: Double) {

let rotation = Init(CABasicAnimation(keyPath: "transform.rotation")) {
$0.duration = NSTimeInterval(duration)
$0.toValue = (angle.degrees)
$0.duration = NSTimeInterval(duration)
$0.toValue = (angle.degrees)
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
}
view.layer.addAnimation(rotation, forKey: "rotation")
Expand Down
12 changes: 6 additions & 6 deletions CircleMenuLib/CircleMenuLoader/CircleMenuLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public class CircleMenuLoader: UIView {
clockwise: true)

let circle = Init(CAShapeLayer()) {
$0.path = circlePath.CGPath
$0.fillColor = UIColor.clearColor().CGColor
$0.path = circlePath.CGPath
$0.fillColor = UIColor.clearColor().CGColor
$0.strokeColor = color?.CGColor
$0.lineWidth = strokeWidth
$0.lineWidth = strokeWidth
}

self.layer.addSublayer(circle)
Expand Down Expand Up @@ -140,9 +140,9 @@ public class CircleMenuLoader: UIView {
layer.transform = rotateTransform

let animation = Init(CABasicAnimation(keyPath: "strokeEnd")) {
$0.duration = CFTimeInterval(duration)
$0.fromValue = (0)
$0.toValue = (1)
$0.duration = CFTimeInterval(duration)
$0.fromValue = (0)
$0.toValue = (1)
$0.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
}
circle?.addAnimation(animation, forKey: nil)
Expand Down

0 comments on commit e6cdacf

Please sign in to comment.