从按钮XIB执行SEGUE(Perform segue from button in XIB)

2019-09-18 17:39发布

我使用了我的大部分项目的故事板,但我有一个UIScrollView的是由那些从厦门国际银行加载多个视图

我被困在如何执行赛格瑞当点击在XIB按钮

我已经做了。

  • 新增的意见,滚动视图
  • 添加自定义按钮
  • 加入IBAcion上的自定义按钮

MainViewController

NSString *nibName = @"coverArticleView";
NSArray *nibObjects = [NSBundle.mainBundle loadNibNamed:nibName owner:self options:nil];
coverArticle *pageView = [nibObjects objectAtIndex:0];
pageView.articleTitle.text = ob.Title;
pageView.articleTitle.numberOfLines =0;
// updating some more properties here & designing the scroll view
[coverArticlesScrollView addSubview:pageView];

coverArticle.m(类XIB的)

- (IBAction)buttonPressed:(id)sender {
NSLog(@"button pressed");
}

当日志“按钮按下”打印,这样的工作。 但是,如何在按下按钮时不我进行SEGUE?

日Thnx

Answer 1:

如何performSegueWithIdentifier:发件人: ?



文章来源: Perform segue from button in XIB