OftenType — my very first application in Swift


Hi, my name’s Dima Pilipenko, and I live in Ukraine, Kiev. I am educated in sociology at KNU and autodidact in IT-sphere. I’m concentrating on realizing interesting and worthwhile projects for social improvement.

I have a solid programming background of 7 years, starting with the Adobe Flash platform, especially ActionScript 3.0. I also have experience in Java, PHP, JS.

Not so long ago, I decided to learn about Apple iOS development by learning Objective-C, because Apple has the highest quality platform.


Why I decided to write in Swift

For first time I’ve published an application in ObjC in the App Store. The Smalltalk language attracted my attention, especially after the similarities with Java syntax. So it was like a breath of fresh air.

Soon I received a proposition about building a custom keyboard app, and decided to start development in Swift, especially as I had already read half of “The Swift Programming Language”, and found its improvements eloquent.


The powerful things I’ve used

With the release of iOS 8, Apple allows custom extensions, one of which is custom keyboards. We’ll focus on that. The idea of the application is to give the user the ability to create custom keys with frequently used words or phrases in addition to the default keyboard.

Through its development I saw and used a lot of convenient features. Considering that it was without Interface Builder, development was from scratch; in spite of this, development in Swift seemed to me as fast as usual. Sure, it depends on clear syntax and rich development approaches at least.

I didn’t have any difficulties developing this application, apart from a special situation with keyboard extensions.

Issue: under no “Open Full Access”, if you use AVFoundation, on calling, for example, “AudioServicesPlaySystemSound” method, the application starts to execute “long call”.
Solution: use it in a closure of “dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0))”, by this the application will differ and execute your code under “Open(ed) Full Access”.


Common impressions

My impressions: Swift doesn’t take as much time for development as other languages I have used, because it is very optimized and cleared from clutter.

Here is a list of the main features that I have used in the development of OftenType application:

  • light visual syntax (no semicolons, no “new” operator, type inference)
  • operators (??, …, ..<, ! etc)
  • optional chaining
  • getter/setter method improvements, at least, “didSet, willSet”
  • convenience initialization
  • subscripts
  • closures!
  • improved switch, enumeration, tuples, also with patterns
  • enums, structs
  • generics!
  • and more brilliant features


If you’re curious, here are some links for my application:

iTunes — https://itunes.apple.com/app/id943946871

Video — https://vimeo.com/114468988

Web site — http://oftentype.com


In next part, I will write more about features I like, and why I found them helpful. Stay tuned.