Lines Matching refs:self
45 if (self = [super init]) {
49 return self;
54 if ([self.mechanism isKindOfClass:[FRATotpOathMechanism class]]) {
55 [self startProgressAnimationTimer];
56 } else if ([self.mechanism isKindOfClass:[FRAHotpOathMechanism class]]) {
57 [self stopProgressAnimationTimer];
59 [self showHideElements];
64 [self stopProgressAnimationTimer];
68 if (self.isEditing) {
70 self.tableViewCell.totpCodeProgress.alpha = 0.0f;
71 self.tableViewCell.hotpRefreshButton.alpha = 0.0f;
74 if ([self.mechanism isKindOfClass:[FRATotpOathMechanism class]]) {
76 self.tableViewCell.totpCodeProgress.alpha = 1.0f;
77 self.tableViewCell.hotpRefreshButton.alpha = 0.0f;
79 } else if ([self.mechanism isKindOfClass:[FRAHotpOathMechanism class]]) {
81 self.tableViewCell.totpCodeProgress.alpha = 0.0f;
82 self.tableViewCell.hotpRefreshButton.alpha = 1.0f;
84 self.tableViewCell.totpCodeProgress.progress = 0.0f;
91 if ([self.mechanism isKindOfClass:[FRATotpOathMechanism class]]) {
92 FRATotpOathMechanism *mechanism = (FRATotpOathMechanism *)self.mechanism;
96 [self showAlert];
99 } else if ([self.mechanism isKindOfClass:[FRAHotpOathMechanism class]]) {
100 FRAHotpOathMechanism *mechanism = (FRAHotpOathMechanism *)self.mechanism;
104 [self showAlert];
109 [self reloadData];
114 [self showHideElements];
115 [self reloadData];
119 if (!self.isEditing) {
120 if (![self mechanismCode]) {
123 [self generateNextCode];
134 NSString* codeValue = [self mechanismCode];
140 [actionSheet showFromRect:self.view.frame inView:self.view animated:YES];
146 return (FRAHotpOathMechanism *)self.mechanism ? ((FRAHotpOathMechanism *)self.mechanism).code : ((FRATotpOathMechanism *)self.mechanism).code;
150 return (FRAHotpOathMechanism *)self.mechanism ? ((FRAHotpOathMechanism *)self.mechanism).codeLength : ((FRATotpOathMechanism *)self.mechanism).codeLength;
154 if (!self.isEditing) {
156 if ([[self mechanism] isKindOfClass:[FRAHotpOathMechanism class]]) {
157 if (![(FRAHotpOathMechanism *)self.mechanism generateNextCode:&error]) {
158 [self showAlert];
160 } else if ([[self mechanism] isKindOfClass:[FRATotpOathMechanism class]]) {
161 if (![(FRATotpOathMechanism *)self.mechanism generateNextCode:&error]) {
162 [self showAlert];
174 if ([self.mechanism isKindOfClass:[FRATotpOathMechanism class]] && !self.isEditing) {
175 FRATotpOathMechanism *mechanism = (FRATotpOathMechanism *)[self mechanism];
180 self.tableViewCell.totpCodeProgress.progress = progress;
181 self.tableViewCell.totpCodeProgress.progressColor = color;
182 self.tableViewCell.code.textColor = color;
184 self.tableViewCell.code.textColor = color;
188 NSString* codeValue = [@"" stringByPaddingToLength:[self mechanismCodeLength] withString:@"●" startingAtIndex:0];
189 NSString *mechanismCode = [self mechanismCode];
190 if (mechanismCode && !self.isEditing) {
196 self.tableViewCell.code.text = [NSString stringWithFormat:@"%@ %@", firstHalf, secondHalf];
200 if (!self.progressAnimationTimer) {
201 self.progressAnimationTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(timerCallback:) userInfo:nil repeats:YES];
206 [self.progressAnimationTimer invalidate];
207 self.progressAnimationTimer = nil;