Skip to content

Commit

Permalink
change logic for naming conventions
Browse files Browse the repository at this point in the history
fix test
  • Loading branch information
kowongh committed May 13, 2020
1 parent ff5d309 commit 63d6131
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Analytics/Classes/Internal/UIViewController+SEGScreen.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ - (void)seg_viewDidAppear:(BOOL)animated
return;
}

NSString *name = [top title];
NSString *name = [[[top class] description] stringByReplacingOccurrencesOfString:@"ViewController" withString:@""];

if (!name || name.length == 0) {
name = [[[top class] description] stringByReplacingOccurrencesOfString:@"ViewController" withString:@""];
// if no class description found, try view controller's title.
name = [top title];
// Class name could be just "ViewController".
if (name.length == 0) {
SEGLog(@"Could not infer screen name.");
Expand Down

0 comments on commit 63d6131

Please sign in to comment.