Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Example/SAConfettiView/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class ViewController: UIViewController {
confettiView.type = .Diamond

// For custom image
// confettiView.type = .Custom
// confettiView.customImage = UIImage(named: "diamond")
// confettiView.type = .Image(UIImage(named: "diamond")!)

// Add subview
view.addSubview(confettiView)
Expand Down
5 changes: 2 additions & 3 deletions Pod/Classes/SAConfettiView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ public class SAConfettiView: UIView {
case Triangle
case Star
case Diamond
case Custom
case Image(UIImage)
}

var emitter: CAEmitterLayer!
public var colors: [UIColor]!
public var intensity: Float!
public var type: ConfettiType!
public var customImage: UIImage?

required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Expand Down Expand Up @@ -73,7 +72,7 @@ public class SAConfettiView: UIView {
fileName = "star"
case .Diamond:
fileName = "diamond"
case .Custom:
case let .Image(customImage):
return customImage
}

Expand Down