Skip to content

Add info for use with storyboards #172

@blwinters

Description

@blwinters

For a while I couldn't figure out why the LTHPasscodeViewController was showing up inconsistently. I thought my problem was related to #145. Then I changed my storyboard initialization process (in order to immediately show a login screen over my UITabBarViewController after launch), and now it's working beautifully. I recommend that you add some info to the How To Use section of the README for use with storyboards.

For me, I had to remove the storyboard name from Target > General > Deployment Info > Main Interface.
screen shot 2016-12-20 at 8 20 34 am

Then in application(didFinishLaunchingWithOptions:)

window = UIWindow(frame: UIScreen.main.bounds)
if let window = window { //setup rootViewController manually instead of using storyboard so that PasscodeViewController can be shown immediately
    window.backgroundColor = UIColor.white
    window.rootViewController = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateInitialViewController()
    window.makeKeyAndVisible()
}

//setup passcode appearance...

if LTHPasscodeViewController.doesPasscodeExist() && LTHPasscodeViewController.didPasscodeTimerEnd() {
    LTHPasscodeViewController.sharedUser().showLockScreen(withAnimation: false, withLogout: false, andLogoutTitle: nil)
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions