-
-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add extended support for SF Symbol configuration #489
Comments
This is certainly a good idea. I suggest adding a Would you be so kind to contribute a pull request? ;-) |
@futuretap I was hoping to apply multiple different Symbol Configurations per ViewController, as the layout might request one configuration per image. Hence my idea of a new parameter in the |
I see. To achieve this example, you’d need a separate class for each background color. Doesn't really scale well, too.
Then you can switch on |
@futuretap That's a great idea, thank you very much. |
@futuretap I have tried this via: - (UITableViewCell*)settingsViewController:(UITableViewController<IASKViewController>*)settingsViewController
cellForSpecifier:(IASKSpecifier*)specifier {
NSLog(@"settingsViewController:cellForSpecifier:");
NSIndexPath* indexPath = [settingsViewController.settingsReader indexPathForKey:specifier.key];
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:indexPath];
if ([specifier.key isEqualToString:@"TEST"]) {
NSString *name = @"cloud.sun";
UIImageConfiguration *config = [UIImageSymbolConfiguration configurationWithPaletteColors:@[
[UIColor systemTealColor], // cloud
[UIColor systemYellowColor] // sun
]];
// Create image:
UIImage *image = [UIImage systemImageNamed:name
withConfiguration:config];
cell.imageView.image = image;
}
return cell;
} But the delegate method is never called (I don't see the Would it be an idea to add a new delegate to customize the image based on identifier? E.g. like: - (UIImage*)settingsViewController:(UITableViewController<IASKViewController>*)settingsViewController
imageForSpecifier:(IASKSpecifier*)specifier; |
Indeed, the delegate is only called for There are so many different properties of a cell that imo it doesn’t scale to add delegate callbacks for all of these. We might rather think of a |
I'm very pleased that InAppSettingsKit version 3.6 now supports SF Symbols via
systemImageNamed:
.One question though, as this opens the door to more customisation. In our apps we use even more native power with
systemImageNamed:withConfiguration:
.For example to apply palette colouring on a SF Symbol:
Since you already use
IASKCellImage
asname
, would it be possible to extend InAppSettingsKit with something like aIASKCellImageConfiguration
, which refers to the name of Class variable of the parent ViewController (e.g.config
in this example)?The good part of
systemImageNamed:withConfiguration:
is that even ifconfig
isnil
, it will ignore the configuration and just acts assystemImageNamed:
.Thank you for considering this improvement.
The text was updated successfully, but these errors were encountered: