Skip to content

Commit

Permalink
add stringFromTBTerminationType method
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseCrocker committed Sep 8, 2015
1 parent 5052613 commit 8b039a4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions TBOOMDetector/TBOOMDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ typedef NS_ENUM(NSInteger, TBTerminationType) {
- (void)logAbort;
- (void)logExit;

+ (NSString*)stringFromTBTerminationType:(TBTerminationType)terminationType;

@end
27 changes: 26 additions & 1 deletion TBOOMDetector/TBOOMDetector.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ - (void)logTerminationEvent:(NSString*)event {


#pragma mark - CrashlyticsDelegate
- (void)crashlyticsDidDetectReportForLastExecution:(CLSReport *)report completionHandler:(void (^)(BOOL submit))completionHandler; {
- (void)crashlyticsDidDetectReportForLastExecution:(CLSReport *)report completionHandler:(void (^)(BOOL submit))completionHandler {
crashWasDetected = YES;
completionHandler(YES);
}
Expand All @@ -211,4 +211,29 @@ - (void)handleTerminateNotification {
}


#pragma mark - class methods
+ (NSString*)stringFromTBTerminationType:(TBTerminationType)terminationType {
switch (terminationType) {
case TBTerminationTypeUnknown:
return @"TBTerminationTypeUnknown";
case TBTerminationTypeAppUpdate:
return @"TBTerminationTypeAppUpdate";
case TBTerminationTypeExit:
return @"TBTerminationTypeExit";
case TBTerminationTypeCrash:
return @"TBTerminationTypeCrash";
case TBTerminationTypeDebugger:
return @"TBTerminationTypeDebugger";
case TBTerminationTypeOSUpdate:
return @"TBTerminationTypeOSUpdate";
case TBTerminationTypeTerminate:
return @"TBTerminationTypeTerminate";
case TBTerminationTypeBackgroundOom:
return @"TBTerminationTypeBackgroundOom";
case TBTerminationTypeForegroundOom:
return @"TBTerminationTypeForegroundOom";
}
}


@end

0 comments on commit 8b039a4

Please sign in to comment.