Skip to content
Open
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
15 changes: 14 additions & 1 deletion Pod/Classes/TSMessageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,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 +257,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 All @@ -273,7 +284,8 @@ - (id)initWithTitle:(NSString *)title
}

UIColor *fontColor = [UIColor colorWithHexString:[current valueForKey:@"textColor"]];


self.backgroundColor = [UIColor colorWithHexString:current[@"backgroundColor"]];

self.textSpaceLeft = 2 * padding;
if (image) self.textSpaceLeft += image.size.width + 2 * padding;
Expand Down Expand Up @@ -592,6 +604,7 @@ - (void)handleTap:(UITapGestureRecognizer *)tapGesture
{
self.callback();
}
[self fadeMeOut];
}
}

Expand Down