迅速。如何通过编程方式创建从自定义CollectionViewCell到.xib文件(viewController)的SEGUE?

发布于 2025-02-13 07:17:21 字数 499 浏览 0 评论 0原文

如何创建 segue 从custom collectionViewCell .xib file (ViewController,是播放器,是播放器),也许是按程序上讲?

我确实在故事板上有Main View Controller ,但几乎所有由代码制作的组件。并且还具有XIB文件 - PlayerViewController

在主中, i具有 CollectionView 自定义单元

并点击任何单元格,我需要将数据(视频对象)推向 PlayerviewController

如果由SEGUE,如何通过代码创建SEGUE标识符? 或在故事板上,但没有“拖放连接”

How to create Segue from custom CollectionViewCell to .xib File (ViewController, is a Player), by programmatically maybe?

I do have main ViewController on Storyboard but almost all components i made by code. And also have xib file - PlayerViewController.

In the main ViewController I have CollectionView with custom cell.

And on tap on any cell I need to push Data (Video object) to PlayerViewController.

If by Segue, how can I create Segue identifier by Code?
Or on storyboard but without “drag-and-connect”

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦初启 2025-02-20 07:17:21

您不需要segue,您可以像这样以编程方式传递数据。

让您假设您的 xib 控制器名称相同。

let controller =  YourViewController()
controller.data = yourdatta
self.navigationController.push(controller)

You do not need segue you can pass data programmatically like this.

Let suppose your XIB and controller name is same.

let controller =  YourViewController()
controller.data = yourdatta
self.navigationController.push(controller)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文