GithubHelp home page GithubHelp logo

Comments (5)

mudithsilva avatar mudithsilva commented on July 21, 2024

i solved this, but i'm new to github , how can i upload my files ?

from slidemenucontrollerswift.

javagc avatar javagc commented on July 21, 2024

You can create fork of this project, make changes and then create pull request

from slidemenucontrollerswift.

Jthami05 avatar Jthami05 commented on July 21, 2024

@mudithsilva , did you ever create an example of a project with a login, and a slide menu attached to the home screen appearing after the login page? I can't get it, either the home screen is made the entry point in AppDelegate.swift, or the menu stops working after I leave the login page. Please help?

from slidemenucontrollerswift.

mudithsilva avatar mudithsilva commented on July 21, 2024

Simply Check whether user logged in or not in the home screen. If not navigate to login page then dismiss the login page to view homepage.

 override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(true)

    let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults()
    let isLoggedIn:Int = prefs.integerForKey("ISLOGGEDIN") as Int
    if (isLoggedIn != 1) {

        var storyboard = UIStoryboard(name: "Main", bundle: nil)
        let vc = storyboard.instantiateViewControllerWithIdentifier("ViewController") as! ViewController
        self.presentViewController(vc, animated: false, completion: nil)

        } else {

        }   
}

Then after the user insert correct information just dismiss the view controller easily

self.dismissViewControllerAnimated(true, completion: nil)

when log out , you should clear the NSUserDefaults, so In the logout function just inser this code for clear NSUserDefaults of the app

   NSUserDefaults.standardUserDefaults().removePersistentDomainForName(NSBundle.mainBundle().bundleIdentifier!)

from slidemenucontrollerswift.

mohitkumat avatar mohitkumat commented on July 21, 2024

@javagc If you do not wan't to make it RootViewController, instead of adding these lines in AppDelegate:

let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController, rightMenuViewController: rightViewController)
self.window?.rootViewController = slideMenuController
self.window?.makeKeyAndVisible()

you can add this in Login/Register success callback function:

let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController, rightMenuViewController: rightViewController)
self.presentViewController(slideMenuController, animated: true, completion: nil)

from slidemenucontrollerswift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.