我是直接在標題位置添加兩個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;