From 6f72517444037d11b6cb2cd00b7149a4487af258 Mon Sep 17 00:00:00 2001 From: Mark Jerde Date: Mon, 6 Nov 2017 10:07:13 -0600 Subject: [PATCH] Modify InAppSettingsKit to recognize a Key key on Group elements allowing the footer text to be pulled from UserDefaults as an alternative to the FooterText key. --- .../Controllers/IASKAppSettingsViewController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/InAppSettingsKit/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m b/InAppSettingsKit/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m index d3e366b..cccfbc3 100644 --- a/InAppSettingsKit/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m +++ b/InAppSettingsKit/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m @@ -476,7 +476,12 @@ CGRect IASKCGRectSwap(CGRect rect); - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { - NSString *footerText = [self.settingsReader footerTextForSection:section]; + IASKSpecifier *specifier = [self.settingsReader headerSpecifierForSection:section]; + NSString *key = (nil == specifier + || ![specifier.type isEqualToString:kIASKPSGroupSpecifier]) + ? nil + : specifier.key; + NSString *footerText = [self.settingsReader titleForId:(nil != key && [self.settingsStore objectForKey:key] != nil) ? [self.settingsStore objectForKey:key] : specifier.footerText]; if (_showCreditsFooter && (section == [self.settingsReader numberOfSections]-1)) { // show credits since this is the last section if ((footerText == nil) || ([footerText length] == 0)) {