Skip to content

Commit

Permalink
Merge pull request #80 from chrisw73/swift-3.1
Browse files Browse the repository at this point in the history
Updated for Swift 3.1
  • Loading branch information
maltebaumann committed Apr 1, 2017
2 parents 8a8a106 + 72496bb commit e1948a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DrawerController/AnimatedMenuButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ open class AnimatedMenuButton : UIButton {
let translation = CATransform3DMakeTranslation(-4 * percentVisible, 0, 0)

let sideInverter: CGFloat = drawerSide == DrawerSide.left ? -1 : 1
topTransform.toValue = NSValue(caTransform3D: CATransform3DRotate(translation, 1.0 * sideInverter * ((CGFloat)(45.0 * M_PI / 180.0) * percentVisible), 0, 0, 1))
bottomTransform.toValue = NSValue(caTransform3D: CATransform3DRotate(translation, (-1.0 * sideInverter * (CGFloat)(45.0 * M_PI / 180.0) * percentVisible), 0, 0, 1))
topTransform.toValue = NSValue(caTransform3D: CATransform3DRotate(translation, 1.0 * sideInverter * ((CGFloat)(45.0 * Double.pi / 180.0) * percentVisible), 0, 0, 1))
bottomTransform.toValue = NSValue(caTransform3D: CATransform3DRotate(translation, (-1.0 * sideInverter * (CGFloat)(45.0 * Double.pi / 180.0) * percentVisible), 0, 0, 1))

topTransform.beginTime = CACurrentMediaTime()
bottomTransform.beginTime = CACurrentMediaTime()
Expand Down
4 changes: 2 additions & 2 deletions DrawerController/DrawerVisualState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public struct DrawerVisualState {
anchorPoint = CGPoint(x: 1.0, y: 0.5)
maxDrawerWidth = max(drawerController.maximumLeftDrawerWidth, drawerController.visibleLeftDrawerWidth)
xOffset = -(maxDrawerWidth / 2) + maxDrawerWidth * percentVisible
angle = -CGFloat(M_PI_2) + percentVisible * CGFloat(M_PI_2)
angle = -CGFloat(Double.pi / 2) + percentVisible * CGFloat(Double.pi / 2)
} else {
sideDrawerViewController = drawerController.rightDrawerViewController
anchorPoint = CGPoint(x: 0.0, y: 0.5)
maxDrawerWidth = max(drawerController.maximumRightDrawerWidth, drawerController.visibleRightDrawerWidth)
xOffset = (maxDrawerWidth / 2) - maxDrawerWidth * percentVisible
angle = CGFloat(M_PI_2) - percentVisible * CGFloat(M_PI_2)
angle = CGFloat(Double.pi / 2) - percentVisible * CGFloat(Double.pi / 2)
}

sideDrawerViewController?.view.layer.anchorPoint = anchorPoint
Expand Down

0 comments on commit e1948a1

Please sign in to comment.