@@ -37,6 +37,7 @@ @interface OTPTokenListViewController () <OTPTokenEditorDelegate>
37
37
38
38
@property (nonatomic , strong ) OTPTokenManager *tokenManager;
39
39
@property (nonatomic , strong ) OTPProgressRing *ring;
40
+ @property (nonatomic , strong ) UILabel *noTokensLabel;
40
41
@property (nonatomic , strong ) UIBarButtonItem *addButtonItem;
41
42
42
43
@end
@@ -77,6 +78,22 @@ - (void)viewDidLoad
77
78
self.tableView .contentInset = UIEdgeInsetsMake (10 , 0 , 0 , 0 );
78
79
self.tableView .allowsSelectionDuringEditing = YES ;
79
80
81
+ self.noTokensLabel = [UILabel new ];
82
+ self.noTokensLabel .numberOfLines = 2 ;
83
+ NSMutableAttributedString *noTokenString = [[NSMutableAttributedString alloc ] initWithString: @" No Tokens\n "
84
+ attributes: @{NSFontAttributeName : [UIFont fontWithName: @" HelveticaNeue-Light" size: 20 ]}];
85
+ [noTokenString appendAttributedString: [[NSAttributedString alloc ] initWithString: @" Tap + to add a new token"
86
+ attributes: @{NSFontAttributeName : [UIFont fontWithName: @" HelveticaNeue-Light" size: 17 ]}]];
87
+ [noTokenString addAttributes: @{NSFontAttributeName : [UIFont fontWithName: @" HelveticaNeue-Light" size: 25 ]}
88
+ range: [noTokenString.string rangeOfString: @" +" ]];
89
+ self.noTokensLabel .attributedText = noTokenString;
90
+ self.noTokensLabel .textAlignment = NSTextAlignmentCenter;
91
+ self.noTokensLabel .textColor = [UIColor otpForegroundColor ];
92
+ self.noTokensLabel .frame = CGRectMake (0 , 0 ,
93
+ self.view .bounds .size .width ,
94
+ self.view .bounds .size .height * 0 .6f );
95
+ [self .view addSubview: self .noTokensLabel];
96
+
80
97
[self update ];
81
98
}
82
99
@@ -92,6 +109,7 @@ - (void)update
92
109
}
93
110
94
111
self.editButtonItem .enabled = !!self.tokenManager .tokens .count ;
112
+ self.noTokensLabel .hidden = !!self.tokenManager .tokens .count ;
95
113
}
96
114
97
115
0 commit comments