cuốn sách gpt4 ai đã làm

swift - 如何在我现有的 XIB 中调用 XIB?

In lại Tác giả: Walker 123 更新时间:2023-11-28 14:24:04 26 4
mua khóa gpt4 Nike

描述:- 我正在为自定义框架编码,为此我到处都使用 XIB,现在我想在我现有的 XIB 中调用另一个 XIB,它的调用非常好但无法执行调用 XIB 的按钮操作。提前致谢 这是代码。

let bundle = Bundle(for: type(of: self)) 
let nib = UINib(nibName: "WelcomeVC", bundle: bundle)
self.contentView = nib.instantiate(withOwner: self, options: nil).first as! UIView
self.addSubview(self.contentView)

câu trả lời hay nhất

MVC - 是全局 iOS 概念。再学习一下。xib - 是 View “V”,“V” - 不能作为 Controller “C”。如果您可以调用 xib - 在 Controller 中进行调用。

关于swift - 如何在我现有的 XIB 中调用 XIB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51741485/

26 4 0
Walker 123
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress