iOS development – adding custom properties

In Notethread I'm developing a tree view to display all notes. I want to attach the Note model to a UIButton, so when the user taps the button it can easily get the correct note data.

This StackOverflow answer helped me do that:

#import <objc/runtime.h>

/* 
 So I can assign a Note per button

http://stackoverflow.com/a/5287141

 */
@interface UIButton (NoteModel)
    @property (nonatomic, strong) Note *note;
@end

@implementation UIButton (NoteModel)
static char noteKey;

- (void)setNote:(Note *)note {
    objc_setAssociatedObject( self, &noteKey, note, OBJC_ASSOCIATION_RETAIN );
}

- (Note *)note {
    return objc_getAssociatedObject(self, &noteKey);
}
@end

What we get is a fairly simple Category. I'm not sure if it's the best solution, but I think it's more elegant than tagging an index number for an array; which was my initial thought.

Posted in iOS, link, programming | Tagged | Comments closed

It’s that easy?

I recently attended the inaugural startup weekend Perth.

It proved to me one thing. I'm lazy.

In 54 hours I was part of a team that helped create a brand new startup. We're all running ahead with it as well to build it into the business we believe it can be.

All it took was focus and a long weekend. We may not have that time blocked out ever. Yet with focus I know I can help craft an idea into a business model in an evening. In about 24 hours have a functioning prototype, all the while ideas were changing on how it should behave.

When I look at what I do it's focus that kills what I can achieve. There's always enough time if you use it right.

Posted in my life | Comments closed

That moment

There's a moment in time where your hard work is rewarded by the simplest of things.

I've been working on Notethread for a long time now. It was a personal goal to release something I thought was different and useful while learning iOS development.

It got downloads, but those users are invisible to me. That lack of connection with something I've dedicated a lot of my free time to is often disappointing. I don't know if I've done enough to define my efforts as a success or a failure. The fact that my app is free may mask a lot of this.

But today got an email. Feedback. Someone that felt strongly enough to find me on Twitter and contact me. To spend time writing ways I can really improve my app. Things I'm going to dedicate my time to for the next release.

That validation is amazing and it only took one person all the way over in Greece to make my day.

To really know that I've made an app that just makes sense to someone is all I needed to justify my time.

Posted in my life, thoughts | Comments closed

AngularJS Now Hosted on Google CDN

Slightly old news now (21st July) I've only just discovered as my interest in AngularJS is picking up.

AngularJS Now Hosted on Google CDN

Thanks to your adoption of AngularJS all over the world, we earned the privilege to be hosted on this state of the art infrastructure. And so I'm happy to share with you, that as of today you can start relying on Google CDN when deploying AngularJS apps.

The latest version (v1.0.1) of AngularJS is currently already deployed on the CDN and we'll be adding newer versions as we release them. The URL for the main angular.min.js file is https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js

Posted in JavaScript, link | Tagged , | Comments closed

piecon

piecon by lipka

A tiny javascript library for generating progress pie charts in your favicon.

Demo here.

Pretty nifty. It's cool to see the status of things in an inactive tab.

Posted in JavaScript, link | Tagged , | Comments closed

Step by step from jQuery to Backbone

fstoerkle has a great step by step conversion

I've seen many struggle when they first meet Backbone.js. In this blog post I will gradually refactor a bit of code from how I used to write JavaScript before, into proper Backbone.js code using models, collections, views and events. Hopefully this process will give you a firm understanding of the core abstractions in Backbone.js.

Posted in JavaScript, jQuery, link, programming | Tagged | Comments closed

JavaScript frameworks

Rich JavaScript Applications – the Seven Frameworks (Throne of JS, 2012)

The premise was to take the seven top JavaScript frameworks/libraries for single-page and rich JavaScript applications — AngularJS, Backbone, Batman, CanJS, Ember, Meteor, Knockout, Spine — get the creators of all of them in one location, and compare the technologies head to head.

Good breakdown of the pro's and con's of each framework.

I've only used Backbone and have mixed feelings about it. I enjoy what it allows me to do along with the separation of concerns, however I do feel it's not the easiest framework to dive into. Personally I don't like having the HTML being dumb, that is, it's not aware of the JavaScript that is binded to it.

I'm more keen on the view understand what it represents. As it stands your JavaScript and HTML are always going to be tightly coupled so I feel having more declarative HTML as a requirement. I'll be checking out AngularJS next as it has covers off my desired requirement. Plus I feel it will be much easier to retrofit existing JavaScript and HTML.

Posted in JavaScript, link, programming | Comments closed