Skip to content

Commit

Permalink
Compatible with Swift 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
niennonno committed May 27, 2017
1 parent 1ee8c73 commit b76025d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AKPickerView/AKPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private class AKCollectionViewLayout: UICollectionViewFlowLayout {
let visibleRect = CGRect(origin: self.collectionView!.contentOffset, size: self.collectionView!.bounds.size)
self.midX = visibleRect.midX;
self.width = visibleRect.width / 2;
self.maxAngle = CGFloat(M_PI_2);
self.maxAngle = CGFloat(Double.pi/2);
}

fileprivate override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
Expand All @@ -152,7 +152,7 @@ private class AKCollectionViewLayout: UICollectionViewFlowLayout {
return attributes
case .wheel:
let distance = attributes.frame.midX - self.midX;
let currentAngle = self.maxAngle * distance / self.width / CGFloat(M_PI_2);
let currentAngle = self.maxAngle * distance / self.width / CGFloat(Double.pi/2);
var transform = CATransform3DIdentity;
transform = CATransform3DTranslate(transform, -distance, 0, -self.width);
transform = CATransform3DRotate(transform, currentAngle, 0, 1, 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down Expand Up @@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
Expand Down Expand Up @@ -59,6 +79,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
Expand Down

0 comments on commit b76025d

Please sign in to comment.