Skip to content

Commit b485156

Browse files
Fix load image bug in bundle
1 parent 42c5c6f commit b485156

File tree

9 files changed

+189
-187
lines changed

9 files changed

+189
-187
lines changed

Example/ParticlesLoadingView.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
7C5775822FA8BD465BD69310 /* Pods_ParticlesLoadingView_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21B343C7A3ABA308245341FE /* Pods_ParticlesLoadingView_Example.framework */; };
1011
AE4CA89A1CEC66DA0074E71F /* Pods_ParticlesLoadingView_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE4CA8991CEC66DA0074E71F /* Pods_ParticlesLoadingView_Example.framework */; };
1112
AE4CA89B1CEC67D00074E71F /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = AEBB69BF1CEC6303001DB4CA /* LaunchScreen.xib */; };
1213
AE4CA89C1CEC67D00074E71F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AEBB69C11CEC6303001DB4CA /* Main.storyboard */; };
@@ -43,6 +44,7 @@
4344
buildActionMask = 2147483647;
4445
files = (
4546
AE4CA89A1CEC66DA0074E71F /* Pods_ParticlesLoadingView_Example.framework in Frameworks */,
47+
7C5775822FA8BD465BD69310 /* Pods_ParticlesLoadingView_Example.framework in Frameworks */,
4648
);
4749
runOnlyForDeploymentPostprocessing = 0;
4850
};

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- ParticlesLoadingView (0.1.0)
2+
- ParticlesLoadingView (0.2)
33

44
DEPENDENCIES:
55
- ParticlesLoadingView (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
ParticlesLoadingView: b758b3305cee56b3fa2c3aa23a97bbe45e71acb4
12+
ParticlesLoadingView: bf9d4b07166ed7d692b1275f7368862da89ee60f
1313

1414
PODFILE CHECKSUM: 045949d6f37f0559cd4ad92def787e1fe4d41009
1515

Example/Pods/Local Podspecs/ParticlesLoadingView.podspec.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 171 additions & 173 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/ParticlesLoadingView/Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/ParticlesLoadingView/ResourceBundle-ParticlesLoadingView-Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ParticlesLoadingView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ParticlesLoadingView"
3-
s.version = "0.1.1"
3+
s.version = "0.2"
44
s.summary = "A loading animation made of particles."
55
s.description = "A customizable SpriteKit particles animation on the border of a view."
66
s.homepage = "https://github.com/BalestraPatrick/ParticlesLoadingView"

Pod/Classes/EmitterCreator.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ public class EmitterCreator {
2121
///
2222
/// - returns: The emitter node object.
2323
func createEmitterNode(effect: ParticleEffect) throws -> SKEmitterNode {
24-
let bundleName = NSBundle(forClass: self.dynamicType).infoDictionary!["CFBundleName"] as! String
24+
let bundle = NSBundle(forClass: self.dynamicType)
25+
let bundleName = bundle.infoDictionary!["CFBundleName"] as! String
2526
let path = NSBundle(forClass: self.dynamicType).pathForResource(effect.rawValue, ofType: "sks", inDirectory: "\(bundleName).bundle")
26-
if let path = path, let emitter = NSKeyedUnarchiver.unarchiveObjectWithFile(path) as? SKEmitterNode {
27+
if let path = path, let emitter = NSKeyedUnarchiver.unarchiveObjectWithFile(path) as? SKEmitterNode, let texture = UIImage(named: "spark", inBundle: bundle, compatibleWithTraitCollection: nil) {
28+
emitter.particleTexture = SKTexture(image: texture)
2729
return emitter
2830
} else {
2931
throw EmitterError.EmitterNodeUnavailable

0 commit comments

Comments
 (0)