//
//  UINavigationItem+DDCategory.m
//  DDCategoryKit_Private
//  Created by DDIsFriend on 2022/11/10.
    

#import "UINavigationItem+DDCategory.h"
#import <DDCategoryKit_Private/NSObject+DDCategory.h>
#import <DDCategoryKit_Private/UIViewController+DDCategory.h>
#import <objc/runtime.h>

@implementation UINavigationItem (DDCategory)
+ (void)load{
    __weak typeof(self) weakSelf = self;
    static dispatch_once_t token;
    dispatch_once(&token, ^{
        __strong typeof(weakSelf) strongSelf = weakSelf;
        
        [strongSelf dd_originSelector:@selector(setLeftBarButtonItem:) swizzleSelector:@selector(dd_setLeftBarButtonItem:)];
        [strongSelf dd_originSelector:@selector(setLeftBarButtonItems:) swizzleSelector:@selector(dd_setLeftBarButtonItems:)];
        [strongSelf dd_originSelector:@selector(setLeftBarButtonItem:animated:) swizzleSelector:@selector(dd_setLeftBarButtonItem:animated:)];
        [strongSelf dd_originSelector:@selector(setLeftBarButtonItems:animated:) swizzleSelector:@selector(dd_setLeftBarButtonItems:animated:)];
        [strongSelf dd_originSelector:@selector(setRightBarButtonItem:) swizzleSelector:@selector(dd_setRightBarButtonItem:)];
        [strongSelf dd_originSelector:@selector(setRightBarButtonItems:) swizzleSelector:@selector(dd_setRightBarButtonItems:)];
        [strongSelf dd_originSelector:@selector(setRightBarButtonItem:animated:) swizzleSelector:@selector(dd_setRightBarButtonItem:animated:)];
        [strongSelf dd_originSelector:@selector(setRightBarButtonItems:animated:) swizzleSelector:@selector(dd_setRightBarButtonItems:animated:)];
    });
}

- (void)dd_setLeftBarButtonItem:(UIBarButtonItem *)leftBarButtonItem{
    
    [self dd_setLeftBarButtonItem:leftBarButtonItem];
}

- (void)dd_setLeftBarButtonItems:(NSArray<UIBarButtonItem *> *)leftBarButtonItems{
    
    [self dd_setLeftBarButtonItems:leftBarButtonItems];
}

- (void)dd_setLeftBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated{
    
    [self dd_setLeftBarButtonItem:item animated:animated];
}

- (void)dd_setLeftBarButtonItems:(NSArray<UIBarButtonItem *> *)items animated:(BOOL)animated{
    
    [self dd_setLeftBarButtonItems:items animated:animated];
}

- (void)dd_setRightBarButtonItem:(UIBarButtonItem *)rightBarButtonItem{
    
    [self dd_setRightBarButtonItem:rightBarButtonItem];
}

- (void)dd_setRightBarButtonItems:(NSArray<UIBarButtonItem *> *)rightBarButtonItems{
    
    [self dd_setRightBarButtonItems:rightBarButtonItems];
}

- (void)dd_setRightBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated{
    
    [self dd_setRightBarButtonItem:item animated:animated];
}

- (void)dd_setRightBarButtonItems:(NSArray<UIBarButtonItem *> *)items animated:(BOOL)animated{
    
    [self dd_setRightBarButtonItems:items animated:animated];
}

@end
