From a289c0178cb2eb1a4c1af01f1893175d7b201cc9 Mon Sep 17 00:00:00 2001 From: Obumbravit <49758667+Obumbravit@users.noreply.github.com> Date: Sat, 24 Apr 2021 00:11:58 -0400 Subject: [PATCH] Add equal spacing outside of main stack --- Library/AppearanceSelectionTableCell.m | 12 +++++++++--- control | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Library/AppearanceSelectionTableCell.m b/Library/AppearanceSelectionTableCell.m index 3281239..8f1071c 100644 --- a/Library/AppearanceSelectionTableCell.m +++ b/Library/AppearanceSelectionTableCell.m @@ -108,8 +108,8 @@ - (AppearanceSelectionTableCell *)initWithStyle:(UITableViewCellStyle)style reus self.containerStackView.translatesAutoresizingMaskIntoConstraints = false; for (NSDictionary *option in self.options) { - AppearanceTypeStackView *stackView = [[AppearanceTypeStackView alloc] initWithType:[self.options indexOfObject:option] - forController:self + AppearanceTypeStackView *stackView = [[AppearanceTypeStackView alloc] initWithType:[self.options indexOfObject:option] + forController:self withImage:[UIImage imageNamed:option[@"image"] inBundle:prefsBundle compatibleWithTraitCollection:NULL] andText:option[@"text"] andSpecifier:specifier]; @@ -140,4 +140,10 @@ - (void)updateForType:(int)type { } } -@end \ No newline at end of file +- (void)layoutSubviews { + [super layoutSubviews]; + + if (self.containerStackView.spacing != (self.bounds.size.width - (60 * [self.options count])) / ([self.options count] + 1)) self.containerStackView.spacing = (self.bounds.size.width - (60 * [self.options count])) / ([self.options count] + 1); +} + +@end diff --git a/control b/control index bc62ae7..75550fb 100644 --- a/control +++ b/control @@ -1,6 +1,6 @@ Package: me.conorthedev.libappearancecell Name: libappearancecell -Version: 1.0.2 +Version: 1.0.3 Architecture: iphoneos-arm Description: A library for that allows developers to use an iOS 13-style appearance selector in their Preferences. Maintainer: ConorTheDev