From 9cbb6b8f9a1e9aec99d6ecb51d126327a3df78b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Fri, 1 Mar 2019 17:48:52 +0100 Subject: [PATCH] Fix potential unknown selector exception --- src/ios/APPPrinterLayout.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ios/APPPrinterLayout.m b/src/ios/APPPrinterLayout.m index 2c67c95..78b93ad 100644 --- a/src/ios/APPPrinterLayout.m +++ b/src/ios/APPPrinterLayout.m @@ -57,11 +57,12 @@ + (UIPrintFormatter *) configureFormatter:(UIPrintFormatter *)formatter withSettings:(NSDictionary *)settings { - id layout = [[self alloc] initWithDictionary:settings]; + id layout = [[self alloc] initWithDictionary:settings]; + SEL setFont = NSSelectorFromString(@"font"); [layout configureFormatter:formatter]; - if (settings && ![formatter isKindOfClass:UIMarkupTextPrintFormatter.class]) + if (settings && [formatter respondsToSelector:setFont]) { [layout configureTextFormatter:(UISimpleTextPrintFormatter *)formatter withSettings:settings];