Any thing can be a dictionary key? Yes, but with a price

January 14, 2014

I like to talk about the difference between different NSDictionary keys. I know it’s cliché.[1]

We all know that building a dictionary is slower than querying it, and that the time it takes to insert or update values depends on the hash function of the key – the interesting part is how incredibly inefficient the hashes of built in objective-c components can be.

Read the rest of this entry »

Advertisements

Custom easing animations with auto layouts

December 22, 2013

Our rock star designer Jonathan Saragousi has a fetish for beautiful easing transitions in our animations. The correct easing method can make the difference between a plain animation and a jaw-dropping one.
In Cal for instance, most of the animations use EaseOutQuart transitions. (You can find a nice demonstration of the different transitions here)
We implement the custom animations using a very cool project called NSBKeyframeAnimation.

A while ago we moved Cal to using Auto layouts, and of course – auto layout does not behave well at all with custom animations.
Read the rest of this entry »


In-app localization

December 9, 2012

Hi guys!

It’s been a LONG time since my last post – I was busy lately getting married to the lovely Einat 🙂

This time I wanted to tell you about how we added in-app localization to Any.DO

Since we added localization to Any.DO a few months ago, we got a lot of feedback asking us to add the option to change the language from inside the app.
As you all know, the common localization method is to simply use NSLocalizedString(key, comment) – a macro for [[NSBundle mainBundle] localizedStringForKey:(key) value:@”” table:nil].

Read the rest of this entry »


Selective layer borders

March 4, 2012

I always though that the most annoying problems are the ones that should have been trivial. Those pesky problems that happen all the time, and for some reason apple didn’t take the time to fix them.

One such problem is the fact that there is no easy way to draw “selective” borders – i.e draw borders only on the left and top side of the view.

This problem keeps popping up for me, the last time was when I was trying to draw a grid view with custom cells. I wanted the cells to have a 1px border, but since all cell had both top and bottom borders, the borders seemed to be 2px wide.

This time I decided to solve this problem the right way and make a simple drop-in class that provides flexible border abilities – something that I could use like this:


myView.borderDirection = AUIFlexibleBordersDirectionRight | AUIFlexibleBordersDirectionTop;

Read the rest of this entry »


Automating UI testing on the iOS

February 26, 2012

A couple of weeks ago I gave a talk about automating UI testing on the iOS at the Second Tel Aviv iOS Developers Meetup. In the lecture I introduced importance of performing automated UI testing, and discussed in details the two most significant tools in this area – Apple’s UIAutomation framework, and Gorilla Logic’s FoneMonkey framework – maybe the greatest testing tool in the universe.

Gorilla Logic - FoneMonkey

Unfortunately, The lecture was not video taped, but the presentation is very elaborate. You can find the presentation on SlideShare, and a project with all the code examples I showed in the presentation can be found on github.

In my opinion, an organized testing culture is one of the key parameters to a successful iOS project, and if you ever wondered what is the best way to automate testing on the iOS – this presentation is a good starting point.

Enjoy.


DreamZ – A lucid dreams inducing iPhone app

November 30, 2011

I recently release a new app that I was working on the last couple of months. This is my first paid app, and in my unbiased opinion, it’s one of the most interesting apps on the market today 🙂

DreamZ is a revolutionary new app that allows you to realize that you are     dreaming and control your dream, otherwise known as a Lucid Dream.

How does it work?

As you sleep you go through different phases, ranging from deep sleep to light sleep. The most interesting phase is the REM (Rapid Eye Movement) phase, in which most dreams occur.

Based on your body movements while you’re asleep, DreamZ is able to know the exact sleep phase you are in, using the built-in iPhone’s sensors.
Read the rest of this entry »


Adding custom code snippets extensions

November 1, 2011

One of the most useful feature of xcode 4 was the built in code snippets library. It allows you to use pre made pieces of code instead of writing them over and over.

You can use those code snippets either by dragging them from the Code Snippet Library section, or by simply typing a completion shortcut.

xcode comes with a variaty of useful code snippets which you are more than welcomed to browse, but today I will show you how to add your own custom code snippets.

Read the rest of this entry »