Project update #4 - My experience with WatchKit

It's Sunday, 12 April 2015, and I am writing this post as promised. But wait a minute; didn't I say that it will be on Saturday? You are right, I did. And I truly wanted to write it yesterday, but there just ended up not being enough time nor positive energy to make the post any good. But I feel a lot better today so lets get started!

What I've been up to these last 4 days

1) Building Routie for Apple Watch

I've spent most Thursday afternoon, Friday morning and part of Saturday afternoon building Routie for Apple Watch. As I said in the last project update, I've started with it this Wednesday, so I am proud to say that it's almost finished!

"Almost finished." – I hate this phrase.

I am happy it's almost finished because it took way less time than I initially expected. But in a way, it took a bit longer. I hoped to get it submitted to App Store by yesterday's evening, which obviously, as you can see, didn't happen.

But lets go over some notes how did the development of the watch app go and what delayed me:

• The WatchKit framework is really slim.

There is not that much you can do with it. But I've already kind of knew that for months, so this wasn't much of a surprise.

• The layout system is actually pretty neat.

As you probably know, WatchKit doesn't use AutoLayout. Instead, it has a concept of groups (vertical or horizontal) and position within those groups. You just add your elements, specify if their width should be relative to its container or fixed, and you can also specify both vertical (Top, Center, Bottom) and horizontal (Left, Middle, Right) centering. In addition, each group can 'hug' its content, among other things. I was pleased to find out that I could accomplish everything that I needed with it.

• Apple's programming guide is all you need.

The Apple Watch Programming Guide really is all you need to get started. That is, if you've done at least some iOS development prior to that. After reading through the whole thing, I got pretty solid understanding and it felt like I knew everything that I needed to build the watch app that I had in mind. It really is very well written and covers all questions you might have; at least it did in my case.

Initially, I considered buying the WatchKit by Tutorials ebook by Ray Wenderlich team, but I wasn't sure I'd absolutely need it and $54 dollars for the PDF version didn't feel justifiable for my simplistic watch app. Plus, after reading the Apple's guide, I knew I don't need it. But if you plan to build something more complex and the Programming Guide wasn't enough for you, this book might be a good option. At least the tutorials they produce are usually very good and highly practical.

• MMWormhole is a life saver.

Because there is no official way how to send live data to your WatchKit extension (or any iOS 8 extension) and listen to their changes, I had to come up with quite complex mechanism in my Today widget for sending the tracking values to shared NSUserDefaults (using App Groups) and then periodically reading them from the defaults to see if there are new values. It was a mess, and I kind of went to terms with the fact that I will have to use the same far-from-ideal mechanism in my Watch App.

That is, until I've learnt about MMWormhole through my friend Patrick Balestra. It's a neat small open source library that uses shared NSUserDefaults in combination with Darwin Notifications, and lets you pass messages accompanied with any NSCopying compliant objects, and then listen to changes of these and use the passed object to update your UI or do whatever you need. It also works both ways (between your containing app and extension). These Darwin notifications ensure that the update is almost instantaneous. Huge thanks goes to Conrad Stoll from Mutual Mobile for creating this and releasing it under MIT license, I am sure that MMWormhole helped tons of people!

Update from Monday 13/4/2015: I got in touch with Conrad on Twitter and he pointed out that MMWormhole leverages shared app groups (I am no expert on this so I am glad he clarified). Here are his tweets:

openParentApplication:reply: is your friend.

This class method of WKInterfaceController lets you open your containing app into background and pass it a message. But not only that, your containing app can send a reply with a dictionary back, enabling you to pass any state information you need. This method is invaluable if your watch app works closely with your containing app.

• When in doubt, update to the latest Xcode and SDK.

There was a bug in the WatchKit that caused the first controller of a paging controller to be full scrollable, even when the content was smaller than the Watch screen. For the life of me, I couldn't figure out why is it happening. It must've been a bug in the framework. After I updated to Xcode 6.3 that contains iOS SDK 8.3, the bug went away.

So the lesson is: always use the latest versions of IDE/SDK.

2) Pushing forward my new website

On Friday afternoon, I'd visited a friend of mine that is building the blog section of my new website, to wash out some rough edges it had. We've moved it forward significantly and during Saturday+today, he finished most of the things we've talked about.

Overall, I am very satisfied with how it went, and a bit ashamed that he is the one who has to wait for my further instructions/feedback. If you need a top web developer that meets all your expectations, you can contact him for a quote at martinmalinda.cz.

The blog is looking great, I can't wait till it replaces the old one!

3) End-of-week crisis and other fun.

Yesterday, similarly to last week, I had kind of a really bad mood. I've failed to finish the Routie for Apple watch app that I set out to finish. And I was terribly tired. And it felt like everything was going south. I didn't want to make another overly pessimistic update so I've decided to leave it for Sunday (today) and just go to our summer house for Sunday.

I cycled from my home to there, and went cycling again today with my father, and it was nice. I rested my mind, changed the environment at least for this one day, and got recharged for the upcoming week. I am glad I went there instead of frantically trying to finish the watch app and writing the update, because I know I would do a sh**ti job and I would risk getting burned out.

My plans for the following days

  • submit new Routie update with the Apple watch app. I have to do this really soon, because it's only 12 days till the launch! Hopefully I will manage to do it tomorrow.

  • deal with the dreadful client job - it's still not done, and it's still bothering me. And tomorrow afternoon, I will probably have an unpleasant chat with them. I just can't wait for it to be over.

  • release the new website! My 'company' website is currently not very good looking (that's the nicest way I could think of to describe it). And as I've mentioned earlier, the new version is almost ready! I just have to take the time to make the decisions to move it forward, and hopefully I can launch it soon. It's mind boggling how long it took already, and I don't even want to think about how many customers I've lost because of it.

And the lesson?

..Right! I almost forgot. This post is way too long, and I don't have anything extra today. In fact, I'll keep it short:

'Almost finished' doesn't count. Every unfinished project that you are juggling is subconsciously taking up your energy and clogging your mind. Just take the time and do whatever is necessary to finish them as soon as you can, one after another. You'll feel a lot better, trust me.

And.. that's it! I am already almost an hour late after my promised date and time of this update. I am sorry for the length again, I couldn't help it. If you've made it this far, kudos! And don't forget to come back here next Wednesday evening, because that's when I will publish the next update!






This post was published as part of an ongoing series about building, marketing and launching a new iPhone app. You can check the past updates here and you can subscribe to receive new updates into your inbox using this form:



*You can unsubscribe at any time and I promise not to spam you.