mirror of
https://github.com/wu736139669/jingdongkaipule.git
synced 2026-08-05 05:55:19 +00:00
34 lines
949 B
Objective-C
34 lines
949 B
Objective-C
//
|
|
// KPWebViewController+hook.m
|
|
// TestKeplerDemo
|
|
//
|
|
// Created by xmfish on 17/1/5.
|
|
// Copyright © 2017年 jd. All rights reserved.
|
|
//
|
|
|
|
#import "KPWebViewController+hook.h"
|
|
#import <objc/runtime.h>
|
|
@implementation KPWebViewController (hook)
|
|
|
|
+ (void)load
|
|
{
|
|
Method ori_Method = class_getInstanceMethod([KPWebViewController class], @selector(viewWillAppear:));
|
|
Method my_Method = class_getInstanceMethod([KPWebViewController class], @selector(ash_viewWillAppear:));
|
|
|
|
method_exchangeImplementations(ori_Method, my_Method);
|
|
}
|
|
|
|
- (void)ash_viewWillAppear:(BOOL)animal
|
|
{
|
|
[self ash_viewWillAppear:animal];
|
|
|
|
UIView* navigationview = [[self valueForKey:@"_kpView"] valueForKey:@"_navigationView"];
|
|
navigationview.hidden = YES;
|
|
UINavigationController* nav = self.navigationController;
|
|
|
|
self.title = @"我才是navigationtitle";
|
|
nav.navigationBar.hidden = NO;
|
|
[nav setNavigationBarHidden:NO];
|
|
}
|
|
@end
|