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.

This commit is contained in:
Mark Jerde 2017-11-06 10:07:13 -06:00
parent 189bd3ce82
commit 6f72517444

View file

@ -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)) {