Skip to content

Commit

Permalink
Support Swift2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavlt committed Sep 19, 2015
1 parent f0d0a2c commit 110b593
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Example/LiquidLoader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@
607FACC81AFB9204008FA782 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
Expand Down
1 change: 1 addition & 0 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pod/Classes/ArrayEx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension Array {

func indexOf <U: Equatable> (item: U) -> Int? {
if item is Element {
return Swift.find(unsafeBitCast(self, [U].self), item)
return unsafeBitCast(self, [U].self).indexOf(item)
}

return nil
Expand Down
8 changes: 4 additions & 4 deletions Pod/Classes/CircularGradientLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class CircularGradientLayer : CALayer {
setNeedsDisplay()
}

required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func drawInContext(ctx: CGContext!) {
override func drawInContext(ctx: CGContext) {
var locations = CGMath.linSpace(0.0, to: 1.0, n: colors.count)
locations = locations.map { 1.0 - $0 * $0 }.reverse()
locations = Array(locations.map { 1.0 - $0 * $0 }.reverse())
let gradients = CGGradientCreateWithColors(CGColorSpaceCreateDeviceRGB(), colors.map { $0.CGColor }, locations)
CGContextDrawRadialGradient(ctx, gradients, self.frame.center, CGFloat(0.0), self.frame.center, max(self.frame.width, self.frame.height), 10)
CGContextDrawRadialGradient(ctx, gradients, self.frame.center, CGFloat(0.0), self.frame.center, max(self.frame.width, self.frame.height), .DrawsAfterEndLocation)
}
}
2 changes: 1 addition & 1 deletion Pod/Classes/LiquidLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class LiquidLoader : UIView {
self.effectDelegate = self.effect.setup(self)
}

public required init(coder aDecoder: NSCoder) {
public required init?(coder aDecoder: NSCoder) {
self.effect = .Circle(UIColor.whiteColor())
super.init(coder: aDecoder)
self.effectDelegate = self.effect.setup(self)
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/LiquittableCircle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LiquittableCircle : UIView {
setup()
}

required init(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/UIView+Grow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension UIView {
let circleGradient = CircularGradientLayer(colors: [growColor, UIColor(white: 1.0, alpha: 0)])
circleGradient.frame = CGRect(x: 0, y: 0, width: radius * 2.0, height: radius * 2.0)
circleGradient.opacity = 0.25
for sub in layer.sublayers {
for sub in layer.sublayers! {
if let l = sub as? CAShapeLayer {
l.fillColor = UIColor.clearColor().CGColor
}
Expand Down

0 comments on commit 110b593

Please sign in to comment.