1414@import WordPressShared;
1515@import WordPressUI;
1616
17- static NSString * const WPTabBarButtonClassname = @" UITabBarButton" ;
1817static NSString * const WPApplicationIconBadgeNumberKeyPath = @" applicationIconBadgeNumber" ;
1918
20- NSString * const WPNewPostURLParamTitleKey = @" title" ;
21- NSString * const WPNewPostURLParamContentKey = @" content" ;
22- NSString * const WPNewPostURLParamTagsKey = @" tags" ;
23- NSString * const WPNewPostURLParamImageKey = @" image" ;
24-
2519NSString * const WPTabBarCurrentlySelectedScreenSites = @" Blog List" ;
2620NSString * const WPTabBarCurrentlySelectedScreenReader = @" Reader" ;
2721NSString * const WPTabBarCurrentlySelectedScreenNotifications = @" Notifications" ;
2822
29- NSNotificationName const WPTabBarHeightChangedNotification = @" WPTabBarHeightChangedNotification" ;
30- static NSString * const WPTabBarFrameKeyPath = @" frame" ;
31-
3223static NSInteger const WPTabBarIconOffsetiPad = 7 ;
3324static NSInteger const WPTabBarIconOffsetiPhone = 5 ;
3425
@@ -53,8 +44,6 @@ @interface WPTabBarController () <UITabBarControllerDelegate>
5344@property (nonatomic , strong ) UIImage *meTabBarImageUnreadUnselected;
5445@property (nonatomic , strong ) UIImage *meTabBarImageUnreadSelected;
5546
56- @property (nonatomic , assign ) CGFloat tabBarHeight;
57-
5847@end
5948
6049@implementation WPTabBarController
@@ -101,11 +90,6 @@ - (instancetype)initWithStaticScreens:(BOOL)shouldUseStaticScreens
10190 options: NSKeyValueObservingOptionNew
10291 context: nil ];
10392
104- [self .tabBar addObserver: self
105- forKeyPath: WPTabBarFrameKeyPath
106- options: NSKeyValueObservingOptionNew
107- context: nil ];
108-
10993 [self observeGravatarImageUpdate ];
11094 }
11195 return self;
@@ -118,7 +102,6 @@ - (instancetype)init
118102
119103- (void )dealloc
120104{
121- [self .tabBar removeObserver: self forKeyPath: WPTabBarFrameKeyPath];
122105 [[UIApplication sharedApplication ] removeObserver: self forKeyPath: WPApplicationIconBadgeNumberKeyPath];
123106}
124107
@@ -403,25 +386,11 @@ - (BOOL)welcomeNotificationSeen
403386
404387- (void )observeValueForKeyPath : (NSString *)keyPath ofObject : (id )object change : (NSDictionary *)change context : (void *)context
405388{
406- if (object == self.tabBar && [keyPath isEqualToString: WPTabBarFrameKeyPath]) {
407- [self notifyOfTabBarHeightChangedIfNeeded ];
408- }
409-
410389 if (object == [UIApplication sharedApplication ] && [keyPath isEqualToString: WPApplicationIconBadgeNumberKeyPath]) {
411390 [self updateNotificationBadgeVisibility ];
412391 }
413392}
414393
415- - (void )notifyOfTabBarHeightChangedIfNeeded
416- {
417- CGFloat newTabBarHeight = self.tabBar .frame .size .height ;
418- if (newTabBarHeight != self.tabBarHeight ) {
419- self.tabBarHeight = newTabBarHeight;
420- [[NSNotificationCenter defaultCenter ] postNotificationName: WPTabBarHeightChangedNotification
421- object: nil ];
422- }
423- }
424-
425394#pragma mark - UIResponder & Keyboard Helpers
426395
427396- (BOOL )canBecomeFirstResponder
0 commit comments