Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The delegate didSwitchFromOldMessage:toNewMessage: now also gets call…

…ed if detailMode != MTDetailModeHistory
  • Loading branch information...
commit 5a56bf55242e85ee37e409f269e086123ee7a3f4 1 parent 54275d4
@myell0w authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 MTStatusBarOverlay.m
View
23 MTStatusBarOverlay.m
@@ -1300,7 +1300,7 @@ - (void)updateUIForMessageType:(MTMessageType)messageType duration:(NSTimeInterv
}
- (void)callDelegateWithNewMessage:(NSString *)newMessage {
- if (self.historyEnabled && [self.delegate respondsToSelector:@selector(statusBarOverlayDidHide)]) {
+ if ([self.delegate respondsToSelector:@selector(statusBarOverlayDidHide)]) {
NSString *oldMessage = nil;
if (self.messageHistory.count > 0) {
@@ -1363,20 +1363,21 @@ - (void)setHistoryEnabled:(BOOL)historyEnabled {
}
- (void)addMessageToHistory:(NSString *)message {
- if (self.historyEnabled && message != nil
+ if (message != nil
&& [message stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]].length > 0) {
- NSIndexPath *newHistoryMessageIndexPath = [NSIndexPath indexPathForRow:self.messageHistory.count inSection:0];
-
// add message to history-array
[self.messageHistory addObject:message];
- [self setDetailViewHidden:self.detailViewHidden animated:YES];
-
- // update history table-view
- [self.historyTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newHistoryMessageIndexPath]
- withRowAnimation:UITableViewRowAnimationFade];
- [self.historyTableView scrollToRowAtIndexPath:newHistoryMessageIndexPath
- atScrollPosition:UITableViewScrollPositionTop animated:YES];
+ if (self.historyEnabled) {
+ NSIndexPath *newHistoryMessageIndexPath = [NSIndexPath indexPathForRow:self.messageHistory.count inSection:0];
+ [self setDetailViewHidden:self.detailViewHidden animated:YES];
+
+ // update history table-view
+ [self.historyTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newHistoryMessageIndexPath]
+ withRowAnimation:UITableViewRowAnimationFade];
+ [self.historyTableView scrollToRowAtIndexPath:newHistoryMessageIndexPath
+ atScrollPosition:UITableViewScrollPositionTop animated:YES];
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.