I don't quite know how I did this...but I like it

I was using Inkscape to try and create a nice background for a new micro app (Caesar Cipher type code wheel) that I'm doing and I think I somehow applied a gradient to the small random text I had generated rather than the background but and I think it actually looks rather good.

(Copyright Human Friendly Ltd 2014)

Just written my first custom UIGestureRecognizer


HFRotationalPanRecognizer is for handling rotational drags and you can find it here. I needed it for a fixed wheel where the two fingered rotation would be inappropriate and confusing. It is suitable for wheels, dials and other fixed rotating issues.

It wasn't too bad once I had my head around it. This article and Erica's book (well I have the iOS 5 version) helped. The key things to remember are to set the gesture state for each move in the gesture as that triggers the update. I also used the same style as the UIPanGestureRecognizer for reporting the move by accumulating it through the gesture but allowing it to be reset by the handler for incremental updates.

I did have quite a bit of trouble sorting out the origin and finished with it settable but always in the superview's co-ordinate space.


UIDynamics - The gotcha!

Make sure you remove all behaviours before directly manipulating a View.

I've been using the iOS 7 framework in a little app I've been writing this week and I was having problems which turned out to be because I wasn't removing all the behaviours from the View before directly transforming it (while it was being dragged).

This includes behaviours that you wouldn't expect to be affected such as UIAttachment anchors pinning the centre of the View to the point which the direct transformation was rotating it. As soon as the dynamic behaviour wants to update the view it will put it where it thinks it should be ignoring all your transformations. Basically (probably for valid performance reasons) the UIDynamics ONLY reads the view's properties when behaviors are added to the view.

It would be nice if there was a call that you could make (either to behaviours or to the UIDynamicAnimator) to inform it of updates to a view so that it could refresh rather than tearing everything down and setting it up again, maybe iOS 8.

Github Expanding Diffs - Great new feature

Github has added a great feature (which Bitbucket already had but I'm excited about anyway).  When you are looking at a commit/pull request or diff it only shows the code immediately around the changes but now you can tap the icon in the gutter to see more code which can be really useful to help understand the commit.

See these screenshots of an example commit to SVGtoIcons. See previous posts for information about that project.




Generating all the icons you need quickly from SVG files - SVGtoIcons

The SVGtoIcons project that I mentioned a couple of posts ago is now in a reasonable state for use by others. I've just added documentation that should make it fairly easy to use.

What is it?

A simple script of less than 150 lines of commented Ruby that use Inkscape to convert SVG files into all the sizes of bitmap (png) that you need. It was written primarily to help me complete the release of Fast Lists 2.0. Inkscape is a nice free (and Free) tool but the export UI made it annoying to create lots of different size bitmaps and I didn't know of a good way to do minor non-destructive changes to the shape of the page that you want to output keeping the drawing centred. This script makes it easy.

While I created it to help with iOS app icons and launch screens it can be used for any particular size outputs. When I use it I generate a couple of icons used within Fast Lists in addition to main App Icons and launch icons.

Why should I care?

Well if you have a designer to create every icon from scratch for each size (iPad, iPhone, portrait, landscape, retina, non-retina and for each context it is used in) then maybe you don't need this. But if you have to create the icons yourself generating them from Scalable Vector Files should produce better results than resizing bitmaps. This helps you do that process quickly.

How do I use it?