Various Improvements

This commit is contained in:
Ilya Laktyushin 2022-01-05 00:52:00 +03:00
parent 322fda56c9
commit db2885d7a9
50 changed files with 1081 additions and 811 deletions

View file

@ -48,7 +48,6 @@ NSInteger UITabBarItem_addSetBadgeListener(UITabBarItem * _Nonnull item, UITabBa
- (NSInteger)addSetSelectedImageListener:(UINavigationItemSetImageListener _Nonnull)listener;
- (void)removeSetSelectedImageListener:(NSInteger)key;
- (NSObject * _Nullable)userInfo;
- (void)setUserInfo:(NSObject * _Nullable)userInfo;
@property (nonatomic, strong) NSString * _Nullable animationName;
@end

View file

@ -16,7 +16,7 @@ static const void *setMultipleRightBarButtonItemsListenerKey = &setMultipleRight
static const void *setBackBarButtonItemListenerBagKey = &setBackBarButtonItemListenerBagKey;
static const void *setBadgeListenerBagKey = &setBadgeListenerBagKey;
static const void *badgeKey = &badgeKey;
static const void *userInfoKey = &userInfoKey;
static const void *animationNameKey = &animationNameKey;
@implementation UINavigationItem (Proxy)
@ -402,12 +402,16 @@ NSInteger UITabBarItem_addSetBadgeListener(UITabBarItem *item, UITabBarItemSetBa
[(NSBag *)[self associatedObjectForKey:setSelectedImageListenerBagKey] removeItem:key];
}
- (NSObject * _Nullable)userInfo {
return [self associatedObjectForKey:userInfoKey];
- (void)setAnimationName:(NSString *)animationName {
[self setAssociatedObject:animationName forKey:animationNameKey];
// [(NSBag *)[self associatedObjectForKey:setBadgeListenerBagKey] enumerateItems:^(UITabBarItemSetBadgeListener listener) {
// listener(badge);
// }];
}
- (void)setUserInfo:(NSObject * _Nullable)userInfo {
[self setAssociatedObject:userInfo forKey:userInfoKey];
- (NSString *)animationName {
return [self associatedObjectForKey:animationNameKey];
}
@end