使用代理跳转
在自定义的view设置代理方法 .h界面
@protocol pushViewControlDelegate <NSObject>
-(void)jumpViewControllerUserId:(NSString *)userId;
@end
@property (nonatomic,weak) id<pushViewControlDelegate> delegate;
if (weakSelf.delegate &&[weakSelf.delegaterespondsToSelector:@selector(jumpViewController:andUserId:)]) {
[weakSelf.delegate jumpViewController:btn andUserId:tempModel.im_user_id];
在VC里面遵守代理
@interface DownOrderViewController ()<pushViewControlDelegate>
FinishedOrder.delegate=self;
实现代理方法
-(void)jumpViewControllerUserId:(NSString *)userId
{
UIViewController * VC=[UIViewControllernew];
[self.navigationControllerpushViewController:VC animated:YES];
}