[英]How to load UIViewController XIB inside another ViewController?
I am trying to add a UIViewController
XIB to an existing ViewController
, trying to create this: 我试图将
UIViewController
XIB添加到现有的ViewController
,尝试创建以下代码:
I have a simple ViewController
and then I made a UIView
with XIB ... and now I am trying to use it in the new ViewController
: 我有一个简单的
ViewController
,然后用XIB制作了一个UIView
...,现在我试图在新的ViewController
使用它:
let myVC = XIBViewController(nibName: "XIBViewController.xib", bundle: nil)
self.present(myVC, animated: true, completion: nil)
How can I make it as small as in the image, with the BaseViewController
still visible? 如何在与
BaseViewController
使其与图像一样小?
Replace ( Remove .xib
) 替换(删除
.xib
)
let myVC = P3XIBViewController(nibName: "P3XIBViewController.xib", bundle: nil)
with 同
let myVC = P3XIBViewController(nibName: "P3XIBViewController", bundle: nil)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.