From 3aa0c012d5d19ab66a858bed225aee63df0238e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Soares?= Date: Tue, 10 Nov 2015 10:33:42 -0200 Subject: [PATCH] Add preprocessor macro "TARGET_INTERFACE_BUILDER" to avoid problems with interface builder. --- DAKeyboardControl/DAKeyboardControl.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DAKeyboardControl/DAKeyboardControl.m b/DAKeyboardControl/DAKeyboardControl.m index c629ca46..03235d07 100644 --- a/DAKeyboardControl/DAKeyboardControl.m +++ b/DAKeyboardControl/DAKeyboardControl.m @@ -42,6 +42,7 @@ @implementation UIView (DAKeyboardControl) + (void)load { +#if !TARGET_INTERFACE_BUILDER // Swizzle the 'addSubview:' method to ensure that all input fields // have a valid inputAccessoryView upon addition to the view heirarchy SEL originalSelector = @selector(addSubview:); @@ -57,6 +58,7 @@ + (void)load class_getMethodImplementation(self, swizzledSelector), method_getTypeEncoding(swizzledMethod)); method_exchangeImplementations(originalMethod, swizzledMethod); +#endif } #pragma mark - Public Methods @@ -747,4 +749,4 @@ - (BOOL)keyboardWillRecede return touchLocationInKeyboardWindow.y >= thresholdHeight && velocity.y >= 0; } -@end \ No newline at end of file +@end