Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismiss notification when tapped #267

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions Pod/Classes/TSMessageView.m
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 Down Expand Up @@ -592,6 +603,7 @@ - (void)handleTap:(UITapGestureRecognizer *)tapGesture
{
self.callback();
}
[self fadeMeOut];
}
}

Expand Down