Skip to content

Commit

Permalink
Fix for use_frameworks!
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwolf committed Feb 28, 2016
1 parent f4cd792 commit 4e21c9a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Pod/Classes/TSMessageView.m
Expand Up @@ -146,6 +146,9 @@ + (NSMutableDictionary *)notificationDesign
if (!_notificationDesign)
{
NSString *path = [[NSBundle bundleForClass:self.class] pathForResource:TSDesignFileName ofType:@"json"];
if (path == nil) {
path = [[NSBundle bundleForClass:[self class]] pathForResource:TSDesignFileName ofType:@"json"];
}
NSData *data = [NSData dataWithContentsOfFile:path];
NSAssert(data != nil, @"Could not read TSMessages config file from main bundle with name %@.json", TSDesignFileName);

Expand All @@ -169,6 +172,13 @@ + (void)addNotificationDesignFromFile:(NSString *)filename

[[TSMessageView notificationDesign] addEntriesFromDictionary:design];
}
else if ([[NSFileManager defaultManager] fileExistsAtPath:[[[NSBundle bundleForClass:[self class]] resourcePath] stringByAppendingPathComponent:filename]]) {
NSDictionary *design = [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfFile:path]
options:kNilOptions
error:nil];

[[TSMessageView notificationDesign] addEntriesFromDictionary:design];
}
else
{
NSAssert(NO, @"Error loading design file with name %@", filename);
Expand Down Expand Up @@ -250,6 +260,10 @@ - (id)initWithTitle:(NSString *)title
{
image = [UIImage imageNamed:[current valueForKey:@"imageName"]];
}
if (!image && [[current valueForKey:@"imageName"] length])
{
image = [UIImage imageNamed:[current valueForKey:@"imageName"] inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil];
}

if (![TSMessage iOS7StyleEnabled])
{
Expand Down

0 comments on commit 4e21c9a

Please sign in to comment.