ios - Swift dynamic cast failed UIPageViewController -
i trying cast window.rootviewcontroller uipageviewcontroller anytime access class property defined blows swift dynamic cast failed. storyboard has uipageviewcontroller initial scene.
pageviewcontroller subclass of uipageviewcontroller
class appdelegate: uiresponder, uiapplicationdelegate, uipageviewcontrollerdatasource { var window: uiwindow! var pageviewcontroller: pageviewcontroller { homecoming window.rootviewcontroller pageviewcontroller } func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: nsdictionary?) -> bool { pageviewcontroller.datasource = self homecoming true } }
the main issue because subclassing uipageviewcontroller had add together custom class viewcontroller within storyboard. @ first figured since pageviewcontroller uipageviewcontroller, , casting rootviewcontroller pageviewcontroller, should've of worked. adding custom class fixed problem.
i tested not subclassing, worked out specifying custom class.
ios swift uipageviewcontroller
No comments:
Post a Comment