diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2017-09-03 20:39:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-03 20:39:53 +0300 |
commit | 09dd0f98da7884abcb0a714976bfbff897c2462b (patch) | |
tree | f0e924137a57abf7931c72c1eb90594e5d83b41b | |
parent | f7c9fcdb00629735b984b26346a42c1826663122 (diff) | |
parent | 01ac79d7a368bcc46656380f7f5fc8e1853a49e0 (diff) |
Merge PR #117: MUCertificateViewController: avoid fancy newline formatting of cert digests.
-rw-r--r-- | Source/Classes/MUCertificateViewController.m | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/Source/Classes/MUCertificateViewController.m b/Source/Classes/MUCertificateViewController.m index 354bdaf..3809b6d 100644 --- a/Source/Classes/MUCertificateViewController.m +++ b/Source/Classes/MUCertificateViewController.m @@ -88,6 +88,9 @@ static const NSUInteger CertificateViewSectionTotal = 4; - (void) viewDidLoad { [self setTitle:_certTitle]; + + [[self tableView] setRowHeight:UITableViewAutomaticDimension]; + [[self tableView] setEstimatedRowHeight:44.0f]; } - (void) viewWillAppear:(BOOL)animated { @@ -285,9 +288,7 @@ static const NSUInteger CertificateViewSectionTotal = 4; MKCertificate *cert = [_certificates objectAtIndex:_curIdx]; NSString *hexDigest = [cert hexDigestOfKind:@"sha1"]; if ([indexPath row] == 0 && hexDigest.length == 40) { - cell.textLabel.text = [NSString stringWithFormat:@"%@\n%@", - [MUCertificateController fingerprintFromHexString:[hexDigest substringToIndex:20]], - [MUCertificateController fingerprintFromHexString:[hexDigest substringFromIndex:20]]]; + cell.textLabel.text = hexDigest; cell.textLabel.textColor = [MUColor selectedTextColor]; cell.textLabel.font = [UIFont fontWithName:@"Courier" size:16]; cell.textLabel.numberOfLines = 0; @@ -298,11 +299,7 @@ static const NSUInteger CertificateViewSectionTotal = 4; MKCertificate *cert = [_certificates objectAtIndex:_curIdx]; NSString *hexDigest = [cert hexDigestOfKind:@"sha256"]; if ([indexPath row] == 0 && hexDigest.length == 64) { - cell.textLabel.text = [NSString stringWithFormat:@"%@\n%@\n%@\n%@", - [MUCertificateController fingerprintFromHexString:[hexDigest substringWithRange:NSMakeRange(0, 20)]], - [MUCertificateController fingerprintFromHexString:[hexDigest substringWithRange:NSMakeRange(20, 20)]], - [MUCertificateController fingerprintFromHexString:[hexDigest substringWithRange:NSMakeRange(40, 20)]], - [MUCertificateController fingerprintFromHexString:[hexDigest substringWithRange:NSMakeRange(60, 4)]]]; + cell.textLabel.text = hexDigest; cell.textLabel.textColor = [MUColor selectedTextColor]; cell.textLabel.font = [UIFont fontWithName:@"Courier" size:16]; cell.textLabel.numberOfLines = 0; @@ -327,15 +324,6 @@ static const NSUInteger CertificateViewSectionTotal = 4; return cell; } -- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if ([indexPath section] == CertificateViewSectionSHA1Fingerprint) { - return 55.0f; - } else if ([indexPath section] == CertificateViewSectionSHA256Fingerprint) { - return 88.0f; - } - return 44.0f; -} - #pragma mark - #pragma mark Table view delegate |