Capturing Your iOS App in Animated GIF Glory

Showing the coolness of your iOS app in a web format can be very difficult, depending on what about your app makes it shine. If your app thrives on animation, especially the new UIKit Dynamics fun, you will need more than one frame to portray what your app does: enter the animated GIF, mother of all awesomeness. Here is the method I used to make the images for my Xamarin UIGravityBehavior recipe. That said, if you know a better way to do this, toss a comment out there; I’d love to hear about it. While I use these methods for my Xamarin.iOS creations, they apply equally to native apps and most anything running on a Mac. The Tool: LICEcap While the name sounds slightly…off, it definitely gets the job done. LICEcap, from Cockos Incorporated, is a quick disk image install. In fact, here’s LICEcap’s capture of me installing LICEcap. One thing to notice, these GIFs are not a great way to capture complex color palettes like the gradients in the install image folder. There may be a tool that is better at that, but you will probably compromise file size for fidelity. That install GIF was 81kb. Capturing the iOS… Continue reading

MonoTouch Programming in Visual Studio

TL;DR Never underestimate the little time sinks of switching between IDEs regularly. To write MonoTouch code in Visual Studio 2010 (debug/deploy still requires MonoDevelop on a Mac), go get VSMonoTouch. If you have any issues getting it going, you may need to toss in some project file tweaks. Set it to not reference mscorlib.dll Set the System.Web.Services reference to version 2.0.5.0 (and likely any others that may conflict with the latest .NET runtime assemblies). Background I’ve been programming with MonoTouch for a few months now using MonoDevelop. I really enjoy learning new things (even if MonoTouch saved me from learning Objective-C), but switching IDEs always tosses a few kinks in my productivity. I have tweaked a number of key bindings in MonoDevelop to match Visual Studio, some at the cost of my ability to adapt to the Mac’s defaults that are normally used everywhere. At one point I switched copy and paste to use Ctrl in MonoDevelop, but then I kept screwing up outside of the IDE. Regardless, I have become fairly productive in MonoDevelop from simply adapting to the new system through repetition (often screwing up when I switch back to Windows now). I don’t really have a problem… Continue reading

Creating an animated spinner in a Xamarin.iOS (MonoTouch) UIImageView

Background I’m well into my first week of building the Sierra Trading Post first iOS app using Xamarin.iOS and it has been a fun ride so far. One of the first things needed was a system for showing a loading image while asynchronously retrieving the final image with a web request. Attempt 1 Xamarin has a recipe for using a UIImageView‘s AnimationImages to make a spinner. UIImageView someImageView = new UIImageView(); someImageView.AnimationImages = new UIImage[] { UIImage.FromBundle(“Spinning Circle_1.png”), UIImage.FromBundle(“Spinning Circle_2.png”), UIImage.FromBundle(“Spinning Circle_3.png”), UIImage.FromBundle(“Spinning Circle_4.png”), }; someImageView.AnimationRepeatCount = 0; // Repeat forever. someImageView.AnimationDuration = 1.0; // Every 1s. someImageView.StartAnimating(); It may be possible to make this work, but it wasn’t quite what I needed. This seems to be more of an image rotation than an animation. As a result, it creates a jerky animation between the various images equally distributed over the AnimationDuration you set. After this, attempts to find some ideas for a better solution lead me to about a hundred lines of code that proved a difficult to consume, involving a CGBitmapContext and CGAffineTransform.MakRotation. (To be fair, this code isn’t doing something as simple as what I want to do.) Hoping to avoid that, I simply added four more… Continue reading