SWRevealViewController disabling user interaction when toggled to Rearview

There is currently no iOS system component that works like a reveal view. I am talking about that sort of left sliding drawer implementation you see in the Facebook app.

I use a third party library called SWRevealViewController. Its a great peice of code by a developer named John Lluch. However there is one annoying problem with the code and every designer I work with insists I have.

When we slide the drawer to reveal the rearview, the front view is partially visible on the right side. If the user taps on a UIControl item, like a UIButton, on this partially visible view, the action is performed while still in the partially visible state. This can be annoying and creates a undesired use case.

SWRevealViewControllerTapIssue

The way I tackle this is to show an overlay view on top of the partially visible front view. This overlay firstly acts as an indicator that this view is currently inactive. Secondly it captures any touch on this view to toggle the front view back!

SWRevealViewFix

Instead of having to write this implementation in every project, I have forked SWRevealViewController and handled it in that code instead. All I have to set now is a boolean called ‘shouldUseFrontViewOverlay’ to YES.

If you find this idea useful, go ahead and use my fork at GitHub.

Advertisements

4 thoughts on “SWRevealViewController disabling user interaction when toggled to Rearview

  1. dStudio says:

    Hi,

    Can you provide a working codebase with your fork implemented i.e. Xcode project with your fork.

  2. Jonathan says:

    I set “self.revealViewController().shouldUseFrontViewOverlay = false” in viewDidLoad() in my project with your fork, and it still doesn’t work ):

  3. @dStudio & @Jonathan: I havent touched this code in a long time. Please take a look at the changes here – https://github.com/NSRover/SWRevealViewController/commit/cd134d822be2895a7666a7ee33480300239d7a4f

    You should be able to debug or come up with your own implementations based on this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: