Kuba Suder's blog on iOS & Mac development

How to add icons to the menu bar on Yosemite

Categories: Cocoa, Mac 4 comments

Mac applications often add their icons to the notification area on the right side of the menu bar. That way they can show you some status changes by changing the icon image, and they can also save some space in your dock by removing the icon from there while still being easily accessible.

If you’re like me, you probably have quite a lot of those there:

The menu bar controls usually display their standard (preferably dark) icon on a standard background by default, and an inverted white icon on a blue background when clicked:

Read more »

Setting up an HTTPS site on Nginx

Categories: Linux 0 comments

This is my SSL configuration guide. There are many like it, but this one is mine…

Last week I needed to set up my first HTTPS site for Hive Mac, and I went ahead and did the same thing for my new blog domain. It took some figuring out, so I’ve written this all down, if only to save myself some time next time I need to do this.

Here’s what you need to do:

Read more »

Making iOS apps compatible with iPhone 6/6+

Categories: Cocoa, iPhone 1 comment

This is the first part of a new (hopefully) longer series of tutorial-like posts. I’m planning to write shorter posts now but more often, based on specific things that I learn while working on my current projects. Let’s see how long I manage to keep this going… :)

Let’s say you have an iOS app that was build for iPhone 5S and earlier. Now that the new iPhones are out, you want to make it work on them too.

If you don’t change anything and just build your app with the latest Xcode and iOS SDK, you’ll see that the app runs on the new iPhones scaled up: the views are rendered on a standard iPhone 5S sized screen and then resized to a bigger resolution like you would resize a static image, together with the top/bottom bars and everything (which obviously doesn’t look good).

To make the app render on the new iPhones natively, you need to let iOS know that it supports them. There are two ways to do that:

Read more »

A guide to NSButton styles

Categories: Cocoa, Mac 9 comments

I don’t know about you, but I never know which NSButton to pick from the Interface Builder library panel. When you start looking for a button there, this is what you see:

13 similar buttons in 3 rows

13 different buttons, all described with the same meaningless description:

The NSButton class is a subclass of NSControl that intercepts mouse-down events and sends an action message to a target object when it’s clicked or pressed.

Each of them looks slightly different, but which of these are you supposed to use in what context?

Read more »

Backbone and Ember

Categories: Frontend, Javascript 0 comments

I’ve read a post comparing Backbone to AngularJS recently, and another that ended with similar conclusions about Backbone, and since I’ve been working with Backbone for the last year or so, I thought it would be a good idea to share my own experiences with it.

In 2012 I’ve been working with a few other developers at Lunar Logic on a new webapp. We’ve decided from the beginning to build it as a single page application, based on an API that was being developed for an existing mobile app. We have considered EmberJS for a moment, but we’ve decided it probably wasn’t stable enough at that point, so we went with Backbone instead.

Looking back I think we made the right choice back then – EmberJS has changed a lot since then (some important parts were still being changed a couple of months ago in 1.0-pre versions), and they still haven’t released a final 1.0, though it seems it’s getting close to that. I’m also glad I had a chance to learn Backbone and get to see its pros and cons. Still, if I was starting the same project right now, I’d probably choose Ember instead.

So what have I learned about Backbone during this year?

Read more »

What's new in ObjectiveC

Categories: Cocoa 0 comments

This post is mostly based on a presentation I’ve done on the last CocoaHeads meeting in Kraków. (If you’re a Cocoa developer and you’re in Kraków on a 2nd Thursday of a month, come say hi!)

Thea idea was basically to collect all the things that have changed in ObjC in the recent years in one place. There were quite a few of these (which is a great thing!) and it’s sometimes hard to remember all of them, especially if you’re trying to update the code of an older project to newer coding style. Hopefully you will also find something here that you didn’t know about before.

Read more »

Pick holes in your Gemfiles

Categories: Ruby/Rails 3 comments

The beginning of 2013 was a really bad time for the Ruby community. In the first few weeks of the year a few separate security issues were found that made everyone run to their SSH consoles to update their Rails apps. Rails itself had to be updated 4 times so far because of this, and even the gem repository has been hacked.

And we aren’t talking about a minor “someone with enough luck and determination can use this for some malicious purpose one day” kind of issue; some of these were the nastiest security holes we’ve seen in years. Check out this article by Patrick McKenzie about what can happen (or rather: will happen) because of these vulnerabilities.

The worst part: it’s probably not the end. The general nature of these bugs – see another article by Aaron Paterson analyzing all the ways in which you can do harm to a Ruby app – means that it’s quite likely that there’s more where that came from.

Now, I don’t know about you, but for me it’s starting to get hard to keep track of all these issues. I know Rails should be updated, but which version was that, 3.2.10 or 3.2.11? Is 2.3.17 OK or was there something newer? And what else was there, json, rack, or was it rake?

Read more »