Slide-Away Screens
In an app I’m working on now I thought I’d give the slide-away screen metaphor a try. Like the one found in the Path and Facebook apps. So I went online and sought a library that could do that for me. Many of the libraries I found were actually for the iPad, and mimicked the behaviour of the Twitter app. Close, but not what I wanted. I found a few libraries, but many of them didn’t support swiping. They were only controlled by a button or some other event.
Finally I found DDMenuController, which seemed to fit what I wanted to do. I experimented with it a bit, and it was easy enough to use. I could also tweak the source code to change how much of the “underneath” controller would show. This was important because I only wanted to show a narrow strip of controls, which isn’t very wide. But soon enough I discovered bugs. Often on a swipe, the underneath controller wouldn’t show at all, but rather it would just be black. I fiddled with the source code a bit and finally got that to happen a lot less often. But when I added a second underneath controller on the right side, the problem came back with a vengeance, and at that point I just gave up.
I looked around again, and found a library I didn’t find the first time. It’s called ViewDeck. So far, I haven’t encountered any bugs, which is good. But I haven’t yet found a way to change how far the main screen moves over. Well, that’s not quite true. I did find something for that, but when I set it to a value I like, the main screen just bounces back and doesn’t stay in the slid-over position. So I’m going to play around with it a little bit and post an update with what I found.
UPDATE 1: I found the solution. It’s just a matter of making sure the rightLedge is large enough to trigger the left edge to stay in place. I’m hoping this works out later when I’ll want a small left underneath view and a large right underneath view.
UPDATE 2: As it turns out, trying to have a large right view was problematic. But I changed the source code to fix that. In (void)panned:(UIPanGestureRecognizer*)panner there’s a divsion by 3.0. I changed that to 4.0 and that made it work.
Leave a comment