squimer / DatePickerDialog-iOS-Swift

Date picker dialog for iOS
MIT License
584 stars 177 forks source link

DatePicker Dialog not showing #20

Closed riazurcse closed 8 years ago

riazurcse commented 8 years ago

Hello Dear, I am using storyboard. If i set entry point using storyboard then dialog working fine. When i set rootViewController programmatically in AppDelegate, DatePickerDialog not working anymore.

window = UIWindow(frame: UIScreen.mainScreen().bounds) window?.makeKeyAndVisible()

    storyboard = UIStoryboard(name: "Main", bundle: nil)

    let homeViewController = self.storyboard?.instantiateViewControllerWithIdentifier("HomeView") as? HomeViewController
    let userTypeController = self.storyboard?.instantiateViewControllerWithIdentifier("UserTypeView") as? UserTypeController

    if self.window != nil {

        let userDataExist = CommonUserFunction.isUserDataExist() as Bool

        if userDataExist == true {

            let navigationController:UINavigationController = storyboard!.instantiateInitialViewController() as! UINavigationController
            navigationController.viewControllers = [homeViewController!]

            self.window!.rootViewController = navigationController
        }
        else{

            let navigationController:UINavigationController = storyboard!.instantiateInitialViewController() as! UINavigationController
            navigationController.viewControllers = [userTypeController!]

            self.window!.rootViewController = navigationController
        }
    }

please Help...Thanks in advance...

lfarah commented 8 years ago

Duplicate of #18