Showing projects tagged with “iOS”

Kodex

Advanced code editor for iOS.

iOS UIKit Swift Objective-C

Screenshot of Kodex

I have always wanted to replace my notebook with a tablet for most of my daily tasks. I couldn't find a code editor for iOS that fit my needs and desires, especially regarding multi-caret edititng, so I decided to write my own.

Kodex has several features I couldn't find in other code editors available for iPad. The main one is multi-caret editing. This feature has become a major tool I consistently use to transform and replicate code, and not having it really hurt my productivity.

This project was started back in June 2017, and it has finally reached the App Store in March 2018. It took several late nights of creating problem solving; studying UIKit, TextKit, and other Apple APIs; and bug solving to reach an MVP.

Some other desktop-class features included in Kodex are:

  • Customizable key bindings
  • Regex search-replace, with capture group highlighting
  • Support for third party fonts (using Configurator system profiles)
  • Source minimap

Kodex development has been very educational and fun. It makes use of some free software packages, without which it Kodex wouldn't be possible. The list of used packages is listed in the Acknowledgements page of the Settings section. I have also made part of its source available under the LGPL license as the KeyCommandKit library, allowing the entire UIKeyCommand customization feature to be implemented by any App.

Pro:Sudoku

Sudoku game for iPad with support for Apple Pencil.

iOS Swift

Screenshot of Pro:Sudoku

I’ve been playing Sudoku since I learned about it in middle school. Either on my iPhone or on my iPad, I always have a game in progress that I go back to from time to time.

One day I had an epiphany: Wouldn’t it be nice if I could play Sudoku on my iPad with Apple Pencil, writing in numbers and clues just like on paper? After searching the App Store, I could only find a couple of apps that supported Apple Pencil input, but none of them preserved the strokes, kinda breaking the concept of playing like on paper.

So I decided to build it!

The first thing I built was a basic game of Sudoku that uses a conventional input model: Taps and buttons. This didn’t take long, but the next step would be harder: I had to make the board accept pencil strokes, and preserve them.

I started with a basic prototype of input taking with the Pencil using a PKCanvasView. After I had that working I had to support scaling the drawings up and down, especially to handle the case where a user resizes the game window by placing a different app side-by-side. This was an important feature to support, because I wanted to let people play the game while reading a tutorial, or watching a video.

Next I had to transform the user drawings into actual numbers. Thankfully Apple’s turicreate makes this extremely straightforward. Once I had a data-set (EMNIST) creating a model that fit my needs took almost no effort. I mostly spent time creating my own classes, as I not only wanted to be able to identify numbers, but also the X character (to allow a simple X gesture to erase a cell), and also a "noise" class with characters I wanted to ignore.

When I had that working, I had to generate my puzzles. This turned out to be a lot harder than I anticipated. Turns out there’s entire bodies of research on this subject. I realized that in order to build a good generator, it was required that I build a step-by-step solver that applies techniques used by human solvers, after all if a human solver can’t solve the puzzle in a straightforward manner, it’s no fun for human solvers (which are the target audience of this app!)

That took a monumental effort, and I spent over two months perfecting my generator/solver against known easy/hard/tough puzzles. In the end I think I came up with a solution that produces interesting games that avoid some pitfalls that make a puzzle annoying to solve (like needing to guess – a good puzzle can be solved simply by applying deterministic rules.)

One last feature I added was giving users the ability to create their own puzzle boards. Previously, when I was playing Sudoku on different apps, I’d occasionally see puzzles on websites or on puzzle books that I wanted to solve on the app, but there was no way to do that. One last feature I wanted to add was challenge puzzles. I contacted the famed Finnish mathematician and Sudoku puzzle creator/solver Arto Inkala who provided me with permission to use his famous Top 10 hardest puzzles in Pro:Sudoku. These puzzles are so hard that most step-by-step solvers are not capable of solving them (including Pro:Sudoku’s).

Overall this was a super fun project to build, and although new features could always be added, I feel like it is in a rather well-rounded state where it could probably stay for a while.

x2048

Hexagonal version of 2048 puzzle game for iOS.

iOS SpriteKit Objective-C

Screenshot of x2048

x2048 is a puzzle game for iPhone, iPad and iPod touch that I developed around 2012. It is a version of the (at the time) popular 2048 puzzle game, but on an hexagonal board instead of a 4x4 matrix.

It was my first proper game for iOS, and it presented several new challenges. It was made using Apple's SpriteKit. One of the main challenges was creating the recursive algorithm that calculates the movement for each disc, detecting discs movements and merges. A bit later I also implemented in-app purchases using Apple's iAP APIs, which was another fun challenge on itself.

x2048 is available for free in the App Store.

At some point I ported the game for macOS, but the gameplay was less than optimal, so I never released it.

In February 2018 I started working on a complete rewrite of this game in Swift, and I plan on releasing this new version in the App Store soon. It should be a cleaned-up, and more robust version of the game, as my old Objective-C code for the first version was starting to show its age.

Is It Down?

Service uptime checker widget for iOS.

iOS UIKit Objective-C

Screenshot of Is It Down?

Widgets in iOS are meant to provide data that is brief and meaningful at a glance. When lock screen widgets were announced, I quickly came up with the idea of this widget.

Simply put, it allows the user to pick which servers, and individual ports on each server, to test every time the widget becomes visible. Due to the limitations of the widget framework on iOS, it is not possible to run the checks on the background and send notifications to the user, but it still works well enough.

On top of that, there is a “Tap to Update” button that allows the user to manually check for the status of all servers.

This is my most popular app in the App Store, and I believe it is because it has a simple premise, and delivers on it well. It was a simple App to develop, but I don't think this diminishes its relevance at all.

TapWheel

iPod Classic simulator for iOS.

iOS UIKit Objective-C

Screenshot of TapWheel

This was an experiment to discover how complicated it would be to write an iPod simulator that actually plays music. Result: not too bad!

It uses the Audio library of the device it is running from (therefore won't run properly in a simulator) and uses actual UIKit table views configured to emulate the iPod interface. Also, the click wheel accepts rotary inputs just like the real thing.

There are several unimplemented features, and many screens are blank when they are opened through navigation. But the basic music playback for artists, albums, and tracks is all there. It also includes an animated “Now Playing” screen that imitates the “marquee” txt labels used by the iPod UI.

Unfortunately Apps that emulate an iPod are vetoed by Apple (guess how many people must have tried that already), so this won't be in the App Store any time soon...