From 13103225e2dbbb501a81adc332bfe6ddbafe94b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaz=C4=B1m=20Gu=CC=88nay?= Date: Wed, 9 Nov 2016 15:45:52 +0300 Subject: [PATCH] we have already checked if self is equal to super init at the top of the function. Seems unnecessary --- Classes/PXAlertView.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Classes/PXAlertView.m b/Classes/PXAlertView.m index 08a7d17..f83b8a8 100644 --- a/Classes/PXAlertView.m +++ b/Classes/PXAlertView.m @@ -221,12 +221,9 @@ - (id)initWithTitle:(NSString *)title [self setupGestures]; - if ((self = [super init])) { - NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; - [center addObserver:self selector:@selector(keyboardWillShown:) name:UIKeyboardWillShowNotification object:nil]; - [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; - } - return self; + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + [center addObserver:self selector:@selector(keyboardWillShown:) name:UIKeyboardWillShowNotification object:nil]; + [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; } return self; }