36 lines
781 B
Objective-C
Executable File
36 lines
781 B
Objective-C
Executable File
//
|
|
// UIViewController+BMNavigationView.m
|
|
// buymore
|
|
//
|
|
// Created by yuebin on 2020/8/31.
|
|
// Copyright © 2020 JLC. All rights reserved.
|
|
//
|
|
|
|
#import "UIViewController+BMNavigationView.h"
|
|
#import <objc/runtime.h>
|
|
|
|
@implementation UIViewController (BMNavigationView)
|
|
|
|
static NSString *navViewName = @"bm_navView";
|
|
|
|
- (void)setBm_navView:(CustomNavigationView *)bm_navView {
|
|
if (bm_navView != self.bm_navView) {
|
|
//防止多次调用set
|
|
[bm_navView removeFromSuperview];
|
|
[self.view addSubview:bm_navView];
|
|
|
|
//存储
|
|
objc_setAssociatedObject(self, &navViewName, bm_navView, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
}
|
|
}
|
|
|
|
- (CustomNavigationView *)bm_navView {
|
|
|
|
return objc_getAssociatedObject(self, &navViewName);
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|