Fix potential unknown selector exception
This commit is contained in:
parent
9362e4c341
commit
9cbb6b8f9a
@ -57,11 +57,12 @@
|
|||||||
+ (UIPrintFormatter *) configureFormatter:(UIPrintFormatter *)formatter
|
+ (UIPrintFormatter *) configureFormatter:(UIPrintFormatter *)formatter
|
||||||
withSettings:(NSDictionary *)settings
|
withSettings:(NSDictionary *)settings
|
||||||
{
|
{
|
||||||
id layout = [[self alloc] initWithDictionary:settings];
|
id layout = [[self alloc] initWithDictionary:settings];
|
||||||
|
SEL setFont = NSSelectorFromString(@"font");
|
||||||
|
|
||||||
[layout configureFormatter:formatter];
|
[layout configureFormatter:formatter];
|
||||||
|
|
||||||
if (settings && ![formatter isKindOfClass:UIMarkupTextPrintFormatter.class])
|
if (settings && [formatter respondsToSelector:setFont])
|
||||||
{
|
{
|
||||||
[layout configureTextFormatter:(UISimpleTextPrintFormatter *)formatter
|
[layout configureTextFormatter:(UISimpleTextPrintFormatter *)formatter
|
||||||
withSettings:settings];
|
withSettings:settings];
|
||||||
|
Loading…
Reference in New Issue
Block a user