Hurrah for iDevBlogADay! Thanks again to Miguel for the crazy amount of work he’s put into getting this new generation back up and running. I’ve decided to bring a new format and structure to these weekly blog posts, with a useful tech tip, followed by an update on what I’ve been doing, and ending with an inspirational or challenging quote.

Tech Tip: Two Finger Scrolling In UIScrollViews

Tech tip first for those stumbling in from El Goog. I recently needed to make a UIScrollView that didn’t pan when a single finger is dragged over it, but instead passed this action onto it’s child view. Not as simple as you might think! You can’t intercept touchesBegan, because it never gets called if the pan gesture is detected. There are some solutions out there that subclass UIWindow and do some crazy stuff – I think this solution is much nicer. The approach is to subclass UIScrollView, and modify the pan gesture recogniser that the scroll view already has to require a minimum of two touches:

- (id)initWithFrame:(CGRect)frame 
{
    if(self = [super initWithFrame:frame])
    {
        for (UIGestureRecognizer *gestureRecognizer in [self gestureRecognizers])
        {
            if([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) 
            {
                [(UIPanGestureRecognizer*)gestureRecognizer setMinimumNumberOfTouches:2]; 
            }
        }
    }
    return [super initWithFrame:frame];
} 

I should point out that I haven’t submitted any apps with this code in to the App Store, and we’re cutting pretty close to some private APIs, However, as we’re not explicitly calling any of them, I’m pretty sure that it’ll be fine.

Update: A Job, a Game and an App

In my last post, I talked about how I was looking for full-time work. Since then, I’ve started working for a company that specialises in NFC developing BlackBerry apps. Having been there a few months, I still think it was a good move, and things have worked out pretty much how I anticipated (although BlackBerry development is slower and more painful than I could possibly have imagined). Working on my own projects in the evenings took some getting used to, but now I’ve got into the flow of things, I’m finding that actually I can get quite a bit done. Of course it’s still frustrating that I can’t work on Rizer projects all the time, but frustration can be a great driving force.

I’ve found that being motivated to work in the evenings requires that I need to be exceptionally passionate about what I’m creating. At the point of going full time, I was working on a phoenix game, and didn’t really know where it was going, so it wasn’t long before I came up with something new. What I’m now working on is a multiplayer, turn-based murder mystery game. As the idea stands, one player will be the murderer, trying to hide clues in the mansion, while the others search for clues trying to find out who the murderer is. There are a lot of unknowns in how all that’s going to work, but that’s part of the fun of game development!

I chose to make the new game in pixel art, and I’m so glad I did. I’d always avoiding using it in the past as it’s so heavily used by indies, but I’ve really enjoyed making the assets so far. Having to carefully consider each and every pixel, and what shade it will be to give the right suggestion of what it’s representing is a real challenge, but I know it’s making me a better game developer. The amount of pixel art I’m going to need is pretty daunting, and now that I’ve got a shiny new iPad, and given that the iPad is so great for drawing, I went looking for a pixel art iPad app. There are a couple that look ok, but I fancy creating my own, so that’s what I’m doing. I forgot how quick, easy and fun UIKIt is to develop with. After a couple of evenings of work, I have some simple editing functionality, with the ability to select a colour from the image, paint in that colour, erase, and zoom in and out keeping everything nice and pixelly.

Quote

I’ve been watching Kevin Rose’s Foundation videos, where he interviews a range of entrepreneurs asking them how they got started. One of the things that really stood out for me was in his interview with Second Life Founder, Philip Rosedale, giving advice on being transparent.

“To the level of where it hurts, tell everybody.”