我是直接在标题位置添加两个button 加载两个viewcontroller 简单粗暴实现顶部切换卡
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.bounds)/2-60, 0, 120, 30)];
_tabMeet = [UIButton buttonWithType:UIButtonTypeCustom];
_tabMeet.frame = CGRectMake(0, 0, 40, 30);
[_tabMeet setTitle:@"邂逅" forState:UIControlStateNormal];
[_tabMeet setTitleColor:[UIColor whiteColor]forState:UIControlStateNormal];
[titleView addSubview:_tabMeet];
_tabNearby = [UIButton buttonWithType:UIButtonTypeCustom];
_tabNearby.frame = CGRectMake(80, 0, 40, 30);
[_tabNearby setTitle:@"附近" forState:UIControlStateNormal];
[_tabNearby setTitleColor:[UIColor whiteColor]forState:UIControlStateNormal];
[_tabNearby addTarget:self action:@selector(showNearby:) forControlEvents:UIControlEventTouchUpInside];
[titleView addSubview:_tabNearby];
self.navigationItem.titleView = titleView;