1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// GMPhobosController.m
// GMPhobos
//
// Created by wangyang on 2017/2/7.
// Copyright © 2017年 licong. All rights reserved.
//
#import "GMPhobosController.h"
@interface GMPhobosController ()
@end
@implementation GMPhobosController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// 导航栏隐藏在 viewWillAppear 里控制的原因是在viewDidLoad时,有可能 navigationController 与 self 并没有关系
self.navigationController.navigationBarHidden = YES;
[[Phobos sharedClient] onPVStart:self];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
// 如果栈内的层级小于等于两个,取消隐藏下面的tabbar
if (self.navigationController.childViewControllers.count <= 2) {
[self setHidesBottomBarWhenPushed:NO];
}
if (self.pageName.length > 0) {
[[Phobos sharedClient] onPVEnd:self];
}
}
@end