SwRevealViewController right menu

Discussion in 'iOS Programming' started by erdinc27, Dec 12, 2016.

  1. erdinc27 macrumors regular

    Joined:
    Jul 20, 2011
    #1
    Hi all. I implemented SwRevealViewController in my project. I used to use it in many projects. But in this one i had to have a right view controller also. The problem i face is that in the project i have two kind of users. One of that users will have Right view Controller another one can not. How can i block right view controller if the user doesnt have to have it ?
     
  2. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #2
    I assume you have some flag that is set after the user logs in. What I do with SWReveal is set, on the fly, the hidden vc.

    I set an array of info, when the user double taps the header, it changes the content of the VC on the left. If I wanted to, I could simply check the flat for which content the user has rights to would be controlled by inside the array with a flag.

    You could also just load each VC based on which user is logged in. If you need to log people in, you can use things like a singleton or pass info around in an array. Maybe a user settings file.

    I was going to cut-n-paste some code, but it looks like it wants to bring a bunch of junk with the code.
     

Share This Page