From 2be4d6930bb6e37debd08d00d8edc5c8a2d65c3a Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Thu, 24 Sep 2020 19:43:33 -0700 Subject: [PATCH] Remove the description label from the alt icon UI I thought it looked ugly and was a bit pointless. It's still there for VoiceOver users though. --- app/AltIconViewController.m | 9 ++++++--- app/Base.lproj/About.storyboard | 22 ++++++---------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/app/AltIconViewController.m b/app/AltIconViewController.m index 4dd4b361..5144b294 100644 --- a/app/AltIconViewController.m +++ b/app/AltIconViewController.m @@ -21,7 +21,6 @@ @property (weak, nonatomic) IBOutlet UIImageView *imageView; @property (weak, nonatomic) IBOutlet UIImageView *checkboxImageView; -@property (weak, nonatomic) IBOutlet UILabel *descriptionLabel; @property (weak, nonatomic) IBOutlet UIButton *authorButton; @property (nonatomic) NSString *link; @@ -128,15 +127,18 @@ // self.checkboxImageView.backgroundColor = UIColor.whiteColor; // self.checkboxImageView.layer.cornerRadius = self.checkboxImageView.bounds.size.width / 2; } - + self.authorButton.titleLabel.adjustsFontForContentSizeCategory = YES; + + self.isAccessibilityElement = YES; + self.accessibilityCustomActions = @[[[UIAccessibilityCustomAction alloc] initWithName:@"Open link" target:self selector:@selector(openSource:)]]; } - (void)updateImage:(UIImage *)image description:(NSString *)description author:(NSString *)author link:(NSString *)url { self.imageView.image = image; - self.descriptionLabel.text = description; [self.authorButton setTitle:[NSString stringWithFormat:@"by %@", author] forState:UIControlStateNormal]; self.link = url; + self.accessibilityLabel = [NSString stringWithFormat:@"%@ by %@", description, author]; } - (IBAction)openSource:(id)sender { @@ -146,6 +148,7 @@ - (void)setSelected:(BOOL)selected { [super setSelected:selected]; self.checkboxImageView.hidden = !selected; + self.accessibilityTraits = selected ? UIAccessibilityTraitSelected : 0; } @end diff --git a/app/Base.lproj/About.storyboard b/app/Base.lproj/About.storyboard index 505fa9e9..abb7f591 100644 --- a/app/Base.lproj/About.storyboard +++ b/app/Base.lproj/About.storyboard @@ -1,5 +1,5 @@ - + @@ -551,10 +551,10 @@ - + - + @@ -564,12 +564,6 @@ -