Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我主要将 Storyboards 用于我的应用程序,但是我想为已经在 Storyboard 中的视图控制器制作一个 xib,并将视图控制器内的内容替换为 xib 中的内容。我将如何呈现 xib 并仍然使用故事板?
目前尚不清楚为什么要这样做,但是您对在 xibs 中创建视图的视图控制器执行您通常所做的事情,使用 initWitNibName:bundle: 来实例化控制器,然后将其放在屏幕上,使用推送或呈现ViewController。您使用情节提要的事实与您如何实例化和显示视图控制器无关。