Skip to content

Commit

Permalink
Fix load image bug in bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
BalestraPatrick committed May 29, 2016
1 parent 42c5c6f commit b485156
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 187 deletions.
2 changes: 2 additions & 0 deletions Example/ParticlesLoadingView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
7C5775822FA8BD465BD69310 /* Pods_ParticlesLoadingView_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21B343C7A3ABA308245341FE /* Pods_ParticlesLoadingView_Example.framework */; };
AE4CA89A1CEC66DA0074E71F /* Pods_ParticlesLoadingView_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE4CA8991CEC66DA0074E71F /* Pods_ParticlesLoadingView_Example.framework */; };
AE4CA89B1CEC67D00074E71F /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = AEBB69BF1CEC6303001DB4CA /* LaunchScreen.xib */; };
AE4CA89C1CEC67D00074E71F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AEBB69C11CEC6303001DB4CA /* Main.storyboard */; };
Expand Down Expand Up @@ -43,6 +44,7 @@
buildActionMask = 2147483647;
files = (
AE4CA89A1CEC66DA0074E71F /* Pods_ParticlesLoadingView_Example.framework in Frameworks */,
7C5775822FA8BD465BD69310 /* Pods_ParticlesLoadingView_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- ParticlesLoadingView (0.1.0)
- ParticlesLoadingView (0.2)

DEPENDENCIES:
- ParticlesLoadingView (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
ParticlesLoadingView: b758b3305cee56b3fa2c3aa23a97bbe45e71acb4
ParticlesLoadingView: bf9d4b07166ed7d692b1275f7368862da89ee60f

PODFILE CHECKSUM: 045949d6f37f0559cd4ad92def787e1fe4d41009

Expand Down
10 changes: 5 additions & 5 deletions Example/Pods/Local Podspecs/ParticlesLoadingView.podspec.json

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

4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

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

344 changes: 171 additions & 173 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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 ParticlesLoadingView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ParticlesLoadingView"
s.version = "0.1.1"
s.version = "0.2"
s.summary = "A loading animation made of particles."
s.description = "A customizable SpriteKit particles animation on the border of a view."
s.homepage = "https://github.com/BalestraPatrick/ParticlesLoadingView"
Expand Down
6 changes: 4 additions & 2 deletions Pod/Classes/EmitterCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ public class EmitterCreator {
///
/// - returns: The emitter node object.
func createEmitterNode(effect: ParticleEffect) throws -> SKEmitterNode {
let bundleName = NSBundle(forClass: self.dynamicType).infoDictionary!["CFBundleName"] as! String
let bundle = NSBundle(forClass: self.dynamicType)
let bundleName = bundle.infoDictionary!["CFBundleName"] as! String
let path = NSBundle(forClass: self.dynamicType).pathForResource(effect.rawValue, ofType: "sks", inDirectory: "\(bundleName).bundle")
if let path = path, let emitter = NSKeyedUnarchiver.unarchiveObjectWithFile(path) as? SKEmitterNode {
if let path = path, let emitter = NSKeyedUnarchiver.unarchiveObjectWithFile(path) as? SKEmitterNode, let texture = UIImage(named: "spark", inBundle: bundle, compatibleWithTraitCollection: nil) {
emitter.particleTexture = SKTexture(image: texture)
return emitter
} else {
throw EmitterError.EmitterNodeUnavailable
Expand Down

0 comments on commit b485156

Please sign in to comment.