Commit a8b17c71 authored by Deployer's avatar Deployer

Fixed loading images from Pod bundle

parent baf49d95
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'CedarMaps' s.name = 'CedarMaps'
s.version = '2.0.1' s.version = '2.0.2'
s.summary = 'CedarMaps iOS SDK' s.summary = 'CedarMaps iOS SDK'
# This description is used to generate tags and improve search results. # This description is used to generate tags and improve search results.
...@@ -36,7 +36,7 @@ Pod::Spec.new do |s| ...@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
s.public_header_files = 'CedarMaps/Headers/Public/*.h' s.public_header_files = 'CedarMaps/Headers/Public/*.h'
s.resource_bundles = { s.resource_bundles = {
'CedarMaps' => ['CedarMaps/Assets/*.xcassets'] 'CedarMaps' => ['CedarMaps/Assets/Media.xcassets']
} }
s.public_header_files = 'CedarMaps/Classes/**/*.h' s.public_header_files = 'CedarMaps/Classes/**/*.h'
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
} }
- (void)initialSetup { - (void)initialSetup {
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSBundle *bundle = [self assetsBundle];
[self.logoView setImage:[UIImage imageNamed:@"cedarmaps" inBundle:bundle compatibleWithTraitCollection:nil]]; [self.logoView setImage:[UIImage imageNamed:@"cedarmaps" inBundle:bundle compatibleWithTraitCollection:nil]];
self.attributionButton.alpha = 0; self.attributionButton.alpha = 0;
self.layer.backgroundColor = [UIColor colorWithRed: 249.0/255.0 green: 245.0/255.0 blue: 237.0/255.0 alpha: 1.0].CGColor; self.layer.backgroundColor = [UIColor colorWithRed: 249.0/255.0 green: 245.0/255.0 blue: 237.0/255.0 alpha: 1.0].CGColor;
...@@ -86,12 +86,17 @@ ...@@ -86,12 +86,17 @@
{ {
MGLAnnotationImage *annotationImage = [super defaultAnnotationImage]; MGLAnnotationImage *annotationImage = [super defaultAnnotationImage];
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSBundle *bundle = [self assetsBundle];
UIImage *image = [UIImage imageNamed:@"cedarmaps_default" inBundle:bundle compatibleWithTraitCollection:nil]; if (bundle) {
image = [image imageWithAlignmentRectInsets: UIImage *image = [UIImage imageNamed:@"cedarmaps_default" inBundle:bundle compatibleWithTraitCollection:nil];
UIEdgeInsetsMake(0, 0, image.size.height / 2, 0)]; image = [image imageWithAlignmentRectInsets:
UIEdgeInsetsMake(0, 0, image.size.height / 2, 0)];
[annotationImage setImage:image];
if (image) {
[annotationImage setImage:image];
}
}
return annotationImage; return annotationImage;
} }
...@@ -111,5 +116,15 @@ ...@@ -111,5 +116,15 @@
CGRectGetHeight(self.logoView.bounds)); CGRectGetHeight(self.logoView.bounds));
} }
- (NSBundle *)assetsBundle {
NSBundle *podBundle = [NSBundle bundleForClass:[self classForCoder]];
NSURL *bundleURL = [podBundle URLForResource:@"CedarMaps" withExtension:@"bundle"];
if (bundleURL) {
NSBundle *bundle = [NSBundle bundleWithURL:bundleURL];
return bundle;
}
return nil;
}
@end @end
PODS: PODS:
- CedarMaps (2.0.1): - CedarMaps (2.0.2):
- JSONModel (~> 1.7) - JSONModel (~> 1.7)
- Mapbox-iOS-SDK (~> 3.7) - Mapbox-iOS-SDK (~> 3.7)
- JSONModel (1.7.0) - JSONModel (1.7.0)
...@@ -13,7 +13,7 @@ EXTERNAL SOURCES: ...@@ -13,7 +13,7 @@ EXTERNAL SOURCES:
:path: ../ :path: ../
SPEC CHECKSUMS: SPEC CHECKSUMS:
CedarMaps: c1c9cee22d2a422562fd84f179957d67ad05a3fb CedarMaps: c9aca5ebbd3c2cdb43e0841a95d3497b7c1e80b2
JSONModel: 840bc0fcffb24b8454d2c026bf26fea454b8e98d JSONModel: 840bc0fcffb24b8454d2c026bf26fea454b8e98d
Mapbox-iOS-SDK: 699818d30e1ed4985d3efc6a06c40b90907c586d Mapbox-iOS-SDK: 699818d30e1ed4985d3efc6a06c40b90907c586d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment