Objective-C and Swift

When I first signed up to be an Apple Developer two years ago there was only one language that you could use to develop iOS apps – Objective-C.

In 2014 that changed when Apple introduced Swift. Swift was probably not a wise choice for production code until at least the 2.0 release in 2015 as it was still changing quite a lot, but it has become more stable and mature, and many people are now using it as their main production language.

I started building my first app Decks in early 2014 so I used Objective-C. When Swift was first released I questioned whether I should change over to it straight away as I hadn’t yet released the app, but due to other commitments I ended up not working on iOS development at all for a full year!

This year I’ve picked up my iOS development and have shipped version 1.0 of Decks. I continued to develop Decks in Objective-C because a lot of it was already written and it seemed the wisest thing to do. But I have been learning Swift programming as well.

So when I recently started building my second app, I was unsure which way to go. I already had a lot of Objective-C code I’d worked out for Decks and felt it might be easier to re-use that code and continue building in Objective-C for the time being, but I was also aware that Swift is very much the future. Apple is pushing Swift and it seems sensible to get your head around it as soon as you can.

If this is a hard choice for me having just scrabbled together my first Objective-C app then I can’t imagine how hard it is for developers who have many years of experience and thousands of lines of working tested Objective-C code already written.

Another problem I found was that the support community around Objective-C is far more mature and comprehensive. If you come up against a problem and do a search you’ll find much more help on Google and Stack Overflow for your Objective-C problems than your Swift problems.

A quick check just now on Stack Overflow returned 236,404 questions tagged with “Objective-C” and only 47,747 tagged with “Swift”. It’s amazing how much Swift support there is already but there is understandably a longer and wider history with Objective-C.

This is also the case with libraries. The vast majority of mature, well-supported, third-party libraries are in Objective-C. Again, a quick search on CocoaPods revealed 10,161 Objective-C libraries against 1,054 written in Swift.

These differences are lessening day by day and more community support and libraries for Swift are appearing at a fast rate. In another couple of years Swift will no doubt catch up with Objective-C completely in these regards but in my short learning experience it definitely makes it harder to work in Swift at the moment if you’re a beginner. I have found the support available on Stack Overflow particularly useful.

You can of course use Objective-C within your Swift projects using Apple’s bridging header which allows you to take advantage of Objective-C libraries but then it would still be wise to have some understanding of the Objective-C code in case you need to debug or edit it.

I decided to do a quick experiment and started two versions of the new app, one in Objective-C and one in Swift to just see how different the experience was for me with the knowledge I currently have. So far I have managed to achieve the same in both but it has taken slightly more time and work to develop in Swift and I have also had to use a bridging header to add in an Objective-C library that I couldn’t find an equivalent of in Swift.

I’m not saying that this will be the case for everyone as I am a beginner and I still need a lot of hand-holding to solve problems that more experienced programmers wouldn’t have to deal with, but for me Swift is slightly slower and harder to develop with. This seems strange in some ways as the Swift language itself is less verbose and easier to read and understand, but there is so much useful Objective-C code out there that you can cut and paste and adapt to your needs.

My experiment is still at an early stage and I’ll continue it a while longer before deciding which way to go. Ultimately, I know I’ll have to go with Swift on all new projects, it just makes more sense in the long run.

But my advice to a new developer starting out today on iOS is to learn both languages. You really need to be familiar with Objective-C and Swift at this moment in time.

Decks – The Roadmap

So a couple of days ago I was talking about the things I still have to learn in fulfill the current roadmaps I have for the apps I’m building. And today I thought I’d share the roadmap for Decks in a bit more detail.

On a recent “Developing Perspective” episode David Smith was talking about how it’s not wise to promise features or due dates in case you don’t manage to make good on those promises.

And I completely agree, so the following list comes with a large disclaimer – there are no timescales attached and the functionality may or may not make it into a release version of the app! It’s just a summary of the main themes I’m working on so you can see the direction I currently have planned for the app:

1. Deck styling and options

I purposely removed most of the styling options for the first release to simplify it, but I will be bringing these back steadily over time:

  • More font choices – I’ll be adding a serif option.
  • Deck colours – I’d like to start making the cards more visually striking and so colours will be a way to do this.
  • Device tailored text sizings – on the larger phones and iPad the text on the main view looks far too small, so I’ll be making the text size relative to screens size rather than standard across all devices.
  • Random and shuffle – I’ll be adding a “shuffle” option for decks, currently there is only ordered and random.

2. Card sharing

  • Twitter/Facebook sharing – a share sheet for the current card so you can share your wisdom on your favourite social network.

3. Card Functionality

  • Checkmark cards – “mark as read/done” functionality to remove cards from the main view while still being accessible in the list view.
  • Answer cards – part of the card content will be hidden until you hit the “show answer” button, this is to enhance the learning functionality of the app.

4. Smart Decks

I’d like to make decks location and date aware so that they can become the active decks under those situations, for instance your “shopping list” or your “relaxation techniques” could become active when you are at the supermarket depending upon what your individual requirements are.

5. Sync

Sync your decks between your devices.

6. Deck sharing and Discovery

I plan to eventually build a web back end for Decks that enables the sharing and discovery of new decks.

===

So as you can see I’ve got a lot of exciting things planned in the current roadmap. Some things won’t take too long like the styling and extra card functionality, and some are major projects like the syncing and a web back end for sharing.

If you’d like to try Decks for free then just ask me for a promo code on twitter @markhadley.

Learning Is Hard

I’m just beginning iOS development. It’s an evening and weekend thing. I already have a full-time job as a freelance web developer and plenty of extra work as a father of two young children. But over the last year I’ve learnt enough in my spare time to build and ship my first app.

But I am still very much a beginner.

I’ve now started putting together my second app as well. Both of these apps already have quite well defined roadmaps that include lots of functionality that I don’t yet know how to do!

I’ve already learnt many new things in this process, getting set up as an Apple Developer and learning enough Xcode, Objective-C, and Swift to build and ship an app is not to be under-estimated.

The “learning” is definitely difficult, it takes hard work and tenacity to keep at it. Learning new skills is always harder than just continuing with what you already know how to do. This is why I have well-defined roadmaps, I find that breaking down the things I need to learn into bite-size chunks helps me to keep at it. It’s not such a high wall to climb.

This is the “yet to be learnt” functionality currently in my roadmaps:

  • Share-sheets
  • Search (for table views)
  • Notifications
  • Location awareness
  • Integrating SQLite databases
  • Building a web service back-end
  • Device syncing

Some of those things will be quick to learn and some will not. Some will be easy, some will be difficult, and the list will no doubt be in a constant state of change as well. As your knowledge of a platform increases it gets easier to add each new piece of functionality. There’s probably at least a year or two of work there that I have scheduled for myself.

But I’m not doing it all at once. I have shipped an app and I will now keep iterating on it and shipping each time I have new useful functionality completed. Little and often.

Chip, chip, chip…

Two Weeks In

There is something quite freeing about having no audience. Sure, that’s no kind of long term plan, but it’s great to not have anyone watching while you’re putting things together, working things out, and making things better.

That’s what I keep telling myself anyway!

Two weeks ago I released my first app on the App Store. On and off it has taken me just over a year in the spare time I have, to learn how to build and ship something.

Decks is currently a simple app, it’s not ground-breaking or game-changing, and it’s only at a very early stage, and it’s also not free (although I do have promo codes – see below), but you have to start somewhere. And if my roadmap for the app works out, it could be very useful for quite a few people!

And that was always my plan – to launch a “minimum viable product”, and then iterate often rather than try to craft something perfect in isolation for many months or years. It works better for me that way.

So where are we two weeks in?

Firstly, let me lay out what my expectations were. They were low. Very low! I’ve been working in the web industry for many years and I know how vast and fleeting and competitive the digital world is and how difficult it is to build an audience – it’s slow hard graft.

I started a new blog on a new domain, released a new app and a new website for that app on another new domain, and my only marketing angles were:

  1. Wait for Google to index my blog content.
  2. Tweet to my handful of followers.

Not surprisingly, that hasn’t got me far in two weeks.

No-one is reading this blog.
No-one is visiting the Decks website.
No-one has bought my app.

So how does that feel? Well, as you’d expect I think, somewhat “mixed”. I’m happy I’ve got everything off the ground and that I’ve been posting and starting to find a voice here. And I’m happy with my initial efforts to start to engage and build an audience, but I am only human and as such I suffer from “the hinderances” like anyone else, and doubt has always been a strong one for me.

And that’s why there is a strong “motivational” bent to the posts here. It’s me working on my doubt and keeping myself going. And it’s working so far. I’m enjoying myself.

So what’s the plan from here?

It’s pretty simple:

  1. I continue to write, both to promote my app(s) and to keep myself motivated (and possibly help others in the process).
  2. I continue to learn and code and ship, often.

On a recent episode of Core Intuition, Manton Reece (newly full-time indie) mentioned how he liked it when indie developers shared information about their sales and income. So this is for you Manton, so far we have:

0 sales
£0 income
No graph required just yet!

I will write regularly, perhaps monthly, on how progress is going.

Promo Codes – To Get Decks for Free!

BTW, if anyone does both find this blog post and manage to read to the bottom then I do have promo codes available for Decks, just contact me on twitter @markhadley and you can have a copy of my app for free…

Onwards and upwards…

Decks – Potential Use Cases

If you’ve been following along you’ll know that my first iOS app shipped last week. Decks enables you to collect quotes, creative strategies, questions, facts, ideas, any snippets of text and browse through them in interesting ways.

The initial idea for Decks was to create an app that allowed you to store and easily access “strategies” for various situations originally based upon the “Oblique Strategies” deck of cards.

And while developing the app I thought of many other potential use cases and the idea evolved. So let me talk a little about the sorts of situations I imagine Decks could be useful in?

1. Creative Strategies

This was the original idea for the app. You’re a writer, artist, musician, and you’re experiencing a creative block. You fire up Decks and there is a potential way forward for your stuck mind – “Go for a walk”, “Turn it upside down”. It would be nice to have copies of the major creative strategy decks in the app so that if you own the physical cards then you can also have an electronic version and this is something I’m working on for the near future.

2. Help With Anxiety

Help with Anxiety in Decks

This is another major area where I think the app can be very useful. If you suffer from nerves, anxiety or panic attacks then it can be hard to remember the techniques you might use to calm or help yourself in a moment of anxiety. This is where Decks can help. You can set a deck as “default” so that it loads straight away with the app and you’ll have your techniques right at hand. I’ve included an example deck “Relaxation Techniques” in the app.

3. Spelling and Reading

Help with Reading in Decks

My son is seven and every week he gets a spelling list to learn from school. As part of his learning we put his spellings into Decks (he types them in) and then we browse through the deck to increase his awareness of the words. A deck can work like reading flashcards. There are settings for each deck to control font size, positioning, and card order so you can have a single large word on each card which is pulled randomly from the deck. A list of 100 “High Frequency Words” is included in the app.

4. Collecting and Organising Quotes

Positive Quotes in Decks

Decks is great for collecting and arranging any snippets of text and works well for quotes. Each card has a main text field and an extra field for “title/author/source”. Then the main browse screen allows you to display your quotes in a beautiful way. I’ve included an example deck of positive quotes “Positivity” in the app.

5. Learning Facts / Quiz Questions

Help with Learning Facts in Decks

Decks is great for any list where you want to concentrate on each item for a while, such as learning facts for your homework, or even a list of questions for a quiz . As an example I’ve included a deck “English Monarchs” that contains all the rulers of England from William the Conqueror to Elizabeth II with the dates of their reigns. In the near future I will be adding “answer cards” to help with this sort of list. With an answer card, part of the information will initially be hidden until you click the “Show Answer” button to reveal it.

6. To Do Lists

I’m also currently working on adding checklist functionality to the app. You will be able to mark cards as completed and they will no longer appear in the main deck browse view although they will still be in the list view.

So that was just a quick overview of some of the areas in which Decks could be helpful.

Visit the Decks Website | View Decks on the App Store

Serif Fonts on iOS

Apple seems to have successfully eradicated any variation in typefaces across their ecosystem. iOS9, El Capitan and the new watchOS are San Francisco all the way. I thought the “Introducing the New System Fonts” session was one of the best at WWDC 2015, and includes a great overview of font features.

The terminology of fonts is simple but somewhat confusing: typeface = font family (they’re the same thing) and a font family is made up of fonts – normal, italic, bold, bold italic, black, roman, thin etc. – these are the individual fonts…

And while I whole-heartedly agree that the flat UI from iOS7+ looks infinitely better than the often odd and complex skeuomorphic world of leather and linen that we had before, and it greatly simplifies the job of creating a good UI, the lack of any typeface diversity is a bit sad and a touch dull.

I couldn’t find any other font families except Helvetica Neue used in current Apple apps on my iPhone? There was a time when you could at least choose something different for your own notes, the choices were very bad, but you could choose!

The current landscape of fonts we have in print and on the web is diverse and interesting. Web fonts allow you to add distinct personality to your project and it’s a long time now since the polarising days of serif representing the old-fashioned establishment and sans-serif the modern up-to-date. Luckily, it’s much more nuanced today.

But Apple have fallen out of love with serif and humanist fonts – for now they’re keeping their corporate typography pure and simple. The good news though is that many great typefaces are included in iOS, and so it is up to us to make use of them and many developers already do.

Serif fonts on iOS

When I first built my new iOS app Decks I had a user option which allowed a choice of serif (Palatino) or sans-serif (Helvetica Neue) for the typeface of each deck. I took this out for the first release as I wanted to simplify the app and work on the options further before releasing them. But in the near future this choice will be back…

Serif fonts in Decks

I’d also like to explore the Open Type options available in iOS but still have some research to do on what’s available…

Iterate

Most of my work is building websites for other people. The jobs have a start and an end, and although I often get to revisit projects either to add new functionality or completely modernise them every few years, I don’t iterate on them day by day. And as is the way with client work there are never quite enough resources to do everything exactly how you would like, time and money always lead to some compromises along the way.

In comparison, working on your own projects allows you to iterate on functionality. You don’t have to do everything at once, you can slowly build up from a working core and evolve a project over time. Whether it’s a website or an app, that’s an exciting prospect for me after many years of client work.

Over the years, I have had a handful of web projects that could have worked out this way but never quite went the distance. And while I like to keep my portfolio site shiny and up to date, there’s only so much extra evening and weekend work you can manage to put in around your full-time day job.

But now I have this blog, Decks – my first little app available in the App Store with a good solid roadmap ahead of it, and a second app that I’ve already started. I have some things to iterate on, all I have to do now is turn up every day and do the work!

An Icon for Random

Most music apps have a “loop” and a “shuffle” mode of some kind. You either play your tracks through “in order” or play them in a random order where each track still only plays once – “shuffled”. There is a third option that music apps do not tend to have and that’s a true “random” where each selection is not dependant upon what has already played, so each track could play multiple times. Often such a random setting will stop items being repeated twice in a row but no more than that e.g.

  • Looped/ordered: 12345 12345 12345
  • Shuffled: 13425 54312 43512
  • Random: 132325412123453

The icons usually associated with loop and shuffle are well known:

Loop and Shuffle Icons

Strangely, there seems to be no standard icon for random. If you search for “loop icon” or “shuffle icon” you’ll see countless variations of the above icons but if you search for “random icon” you’ll mainly see the shuffle icon, not a separate third icon.

I suppose this is understandable as you could use the shuffle icon for random unless of course you want to have all three modes together – then you’re stuck. You’ve got a loop and a shuffle icon but what do you use for random.

This is exactly the position I find myself in with my new app Decks. Currently, you can play a deck of cards in either an “ordered” or a “random” way. There isn’t a “shuffle” mode yet but I will be adding that option in the not too distant future, so there will be all three choices for a deck. I use the classic icons above at the moment for “ordered” and “random” – the icon I’m using for random is in fact the shuffle icon!

So when I add shuffle I’ll need an icon design for random to go with the other two. I wanted to try to keep the design conventions of loop and shuffle intact so the three icons look good together. These are three ideas I came up with:

Sketches for a Random Icon

Out of the three I’ve decided to go with the question mark and arrow as that says random to me more than the others. I read icon two more as “in parallel – two things together” and icon three as “one thing splitting into two”.

And here is the finished icon in the app:

Finished Loop Shuffle Random Icons

I like it, but I’m not sure how successful it will be, only time will tell. If you’ve any other ideas for a random icon let me know on twitter.

Introduction to Decks

I’ve just released my first iOS app and it’s called Decks. There’s a website and it’s available on the App Store.

Decks is a simple app at the moment with quite limited functionality, but getting up and running with iOS development takes time. As I previously mentioned, I’ve been working on this for a while and it feels great to finally ship something.

Many years ago when I was an art student I came across Brian Eno and Peter Schmidt’s “Oblique Strategies” deck of cards. The idea is that you can randomly select a card from the deck and get a “strategy” to help with creative block or provide an interesting new way forward for your artistic endeavour:

  • “You are an engineer”
  • “Work at a different speed”
  • “Remove ambiguities and convert to specifics”
  • “Tidy up”…

There are over a hundred cards in the deck. I think they’re great, funny, and useful, even if they just remind you it’s always possible to completely change tack if you get stuck. You can still buy a copy.

A few years ago, I had an idea to do a similar online deck taliored for web design, an “Oblique Strategies for Web Design”, getting clever web folks to submit ideas for cards, but as with many things it remained just an idea!

When I started thinking about ideas for apps, an “Oblique Strategies for iOS” was one of them, and there are already a couple of these, but to be frank they are not very good and whether they have the blessing of Mr Eno et al. is unknown. There are also many other iOS decks of cards for creative block and inspiration in the same vein as Oblique Strategies. And there are also many apps for collecting quotes and flash cards.

Decks fits into all these ecosystems, it doesn’t include Oblique Strategies because that belongs to someone else although it would be nice one day, but it does allow you to create and browse decks of cards in a simple and intuitive way with some interesting functionality. A deck can contain as many cards as you want and each card currently has two fields, the main text of the card and a field for an author, title or source. You can play a deck either in order or randomly, and you can even set a deck as “default” so that it loads straight away with the app. It’s great for collecting, arranging, and keeping text of any kind.

I use it on a daily basis for a number of things:

  • it’s a coin – heads or tails?
  • it helps my son (7) to learn his weekly spelling list
  • it provides me quick access to my list of relaxation strategies – should I need them

I’ve really enjoyed gettting Decks to a version 1.0. I’ve worked hard to make it a professional, quality app right from the start and I have a lot of plans for it, the roadmap is already pretty long.

Visit the Decks website