I’ve been struggling with Swift compilation times recently. Working on a larger app means that we are adding a lot of new Swift code. Swift isn’t the fastest to compile, it sometimes has issues around type inference (Swift 3 appears to improve a lot of this, but at time of writing I hadn’t migrated yet).
Continue reading
I had an interesting discussion with a co-worker yesterday, we were discussing how to grab all the comments from an Objective-C source file. We tried to think about how to do that with a regex, which probably would have worked ok, but definitely wouldn’t have handled all the edge cases easily.
Continue reading
With Xcode 7, Apple has given us a new tool for user interface testing.
I’m not going to cover the basics here, but for an great introduction to user interface testing in Xcode, check out this awesome article: UI Testing in Xcode 7
Continue reading
This guide is how I set up new projects to run unit tests automatically when I push a commit or merge a branch on GitHub for iOS projects.
Continue reading
This is a quick guide that documents how to start developing plugins for Xcode4. You need to have Xcode installed to create plugins.
Continue reading
We will have a look at a TestProject
to get an idea of how jenkins can be used to build, sign and deploy iOS projects. The whole process consists of 4 steps. Note that to deploy an app in this manner, an enterprise distribution certificate is required for each app.
This guide is how I have set up my enterprise builds for my apps that use cocoaPods
for dependencies, but most of the same principles apply for any iOS apps.
Because the project uses cocoaPods
, it means we have to build a workspace and have a build scheme set up.
Continue reading
This is the style guide that I follow when programming in Objective-C, this is for my own reference, but other people may find this useful.
Continue reading
It is pretty rare to actually have to dive into the objc-runtime for any day to day coding. Most developers wont have to touch the runtime, however it is helpful to know what is possible and be able to use it if required. The objective-c runtime is written in C and is how the underlying parts of the objective-c language work including message sending, ivars and properties. This post shows an example of where I have used the Objective-C runtime in one of my projects.
Continue reading
This is a list of git notes that I use everyday. Hopefully someone else finds it useful. I will update this list over time.
Continue reading
This is a simple validation framework that I created for one of my projects that I am releasing under an open source MIT license.
Continue reading
I have created a simple control that subclasses UILabel to add a border. Here’s a screenshot:
Continue reading
Just for fun, I have created a metro themed UIButton for iOS complete with perspective 3D transform animations. Check out the screen shot and video below.
Continue reading
This is the code that I use when setting up a UIScrollView
to contain multiple images that can be scrolled through. I add this code in the viewDidLoad
or viewWillAppear
methods and then set the numberOfViews
to the number of images I want to display. This will also scale the images to fit the size of the screen using an aspect fit scaling. The example code loads images named “image1”, “image2” etc.
Continue reading
One of the projects I am currently working on needs to capture a signature from a user. So I am releasing the simple library that I created for it.
Continue reading
Here is the method that I use to update the UI when a background async thread. This is mostly for my own reference:
Continue reading
In one of my recent projects, the need to encode QR codes on the device came up. I tried a few different methods and wasn’t really satisfied with any of them.
The method detailed here is the one I chose based on ease of use and the quick set up time.
The core library is written in c and the base version can be found here: http://fukuchi.org/works/qrencode/index.html.en (download the entire project below).
Continue reading
One of the pieces of code I find myself re-using constantly is creating a gradient background for a UIView in iOS. This example will show two examples of how to create a simple gradient background.
Continue reading
D*Lite is an incremental heuristic search algorithm that is used by agents (game ai, or robots) where the surrounding terrain is not completely known. The algorithm makes assumptions about the unknown terrain. D*Lite finds the shortest route from the start to the goal position, and as it encounters new obstacles these are taken into account and only part of the path is modified. Alternatively, pathfinding algorithms like A* typically have to replan the entire path when the environment changes.
Continue reading
When I run a command on a machine that I am ssh’ed into, most of the time I want to kill the connection but have the command continue to execute.
Continue reading
A major annoyance for me is saving images from c++. I can’t really find any libraries that I like, they are either too complex for the task or they don’t do what I want them to do. So I have created my own, extremely lightweight image library.
Continue reading
Lately I have been really enjoying a game called Minecraft. It’s an indie game made by one guy, I highly recommend it!
Continue reading
I am starting to learn XNA at the moment, so I am doing what everyone does when they learn a new language - remake their favourite game! I am making a simple remake of the windows version of Chips Challenge using the sprites from the open source clone of the game which can be found here - http://www.muppetlabs.com/~breadbox/software/tworld/ . Although this remake is by no means a full remake or compatible with the original, I am posting the source code so that someone else can learn from this experience. Keep in mind that this is my first game in XNA, so the code is a bit sloppy but it works.
Continue reading
ScienceWA has run a story about my work and my supervisor! First published science magazine article!
Continue reading
This is the GIMIC simulation with dark matter particles included. The volume shows HI gas and how the dark matter moves and is shaped.
Continue reading
Often I find the need to play two videos side by side without borders or separate windows. Until now, I have been converting two videos into a single video which takes forever.
Continue reading
I have been working on displaying the dark matter from the HDF5 data sets that I have been working on for my astronomy work. Over the last couple of days, I got the loading from HDF5 working and the translation into my local coordinates. The volume is changed from point coordinates to voxel coordinates, then scaled and clamped to the bounding box size. This has to be done because the camera slowly zooms in over the course of the animation and some of the gas / dark matter can leave the simulation.
Continue reading
Just a quick update on what I have been working on. One of the first posts on this blog was a terrain viewer. That project was thrown together very quickly for a weekly assessment, so it wasn’t coded very well and was exceptionally bloated for what it did. I have had some spare time, so I started a fresh and commenced building a minimal terrain loader from the ground up. So far, I have terrain loading from file (generated with the tool in previous posts), and displaying a texture mapped, shadowed terrain using glDrawElements. I have specifically not included loading from heightmap in this project because it is easier to load a point struct from a binary file, but heightmap loading could be added in easily and probably will be in the coming days / weeks.
Continue reading
The terrain generated in the last post was quite bumpy, what if I want smooth rolling hills or something that isn’t quite so bumpy. There are two options here - you can either play around with the diamond-square weights and method of generating the terrain or you can smooth the result. The method I have chosen is a mean (average) filter also known as a box filter. The filter works by moving a square (say 3x3) across the terrain values taking the average of the pixels surrounding it to give the center value an averaged result.
Continue reading