Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Swift 3.0 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions Pod/Classes/SAConfettiView.swift
Expand Up @@ -55,7 +55,7 @@ public class SAConfettiView: UIView {

var cells = [CAEmitterCell]()
for color in colors {
cells.append(confettiWithColor(color))
cells.append(confettiWithColor(color: color))
}

emitter.emitterCells = cells
Expand Down Expand Up @@ -85,13 +85,13 @@ public class SAConfettiView: UIView {
return customImage
}

let path = NSBundle(forClass: SAConfettiView.self).pathForResource("SAConfettiView", ofType: "bundle")
let bundle = NSBundle(path: path!)
let imagePath = bundle?.pathForResource(fileName, ofType: "png")
let path = Bundle(for: SAConfettiView.self).path(forResource: "SAConfettiView", ofType: "bundle")
let bundle = Bundle(path: path!)
let imagePath = bundle?.path(forResource: fileName, ofType: "png")
let url = NSURL(fileURLWithPath: imagePath!)
let data = NSData(contentsOfURL: url)
let data = NSData(contentsOf: url as URL)
if let data = data {
return UIImage(data: data)!
return UIImage(data: data as Data)!
}
return nil
}
Expand All @@ -101,7 +101,7 @@ public class SAConfettiView: UIView {
confetti.birthRate = 6.0 * intensity
confetti.lifetime = 14.0 * intensity
confetti.lifetimeRange = 0
confetti.color = color.CGColor
confetti.color = color.cgColor
confetti.velocity = CGFloat(350.0 * intensity)
confetti.velocityRange = CGFloat(80.0 * intensity)
confetti.emissionLongitude = CGFloat(M_PI)
Expand All @@ -110,7 +110,7 @@ public class SAConfettiView: UIView {
confetti.spinRange = CGFloat(4.0 * intensity)
confetti.scaleRange = CGFloat(intensity)
confetti.scaleSpeed = CGFloat(-0.1 * intensity)
confetti.contents = imageForType(type)!.CGImage
confetti.contents = imageForType(type: type)!.cgImage
return confetti
}

Expand Down