![](/img/trans.png)
[英]Could not load NIB in Bundle using storyboards and UIPageViewController
[英]Using UIPageViewController in storyboards
有沒有辦法在沒有編寫代碼的情況下為故事板中的UIPageViewController配置數據源,委托和查看控制器? 我確實在UIPageViewController中看到了數據源和委托的出口,但沒有辦法在場景之間進行連接,也無法在同一場景中添加額外的控制器。
如果在IB中根本無法配置UIPageViewController,那么在Interface Builder中使用UIPageViewController的目的是什么?
它在Xcode中完全可配置。 您將data-source
和delegate
出口連接到繼承適當協議的類( UIPageViewControllerDataSource
和UIPageViewControllerDelegate
)。
但是,您必須為這兩個協議執行一些實現 - 通常是通過訪問模型的數據。 讓UIPageView的控制器處理這兩個協議是常見的,但不是必需的。 如:
@interface MyPageViewController : UIPageViewController
<UITableViewDataSource, UITTableViewDelegate>
...
@end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.