Hacker News new | ask | show | jobs
by Greenisus 5091 days ago
It sounds like a lot of overhead, but it's really quite simple. Objective-C is a bit verbose for a Hacker News comment, so I put it up as a Github Gist: https://gist.github.com/3080870

As for making a Settings bundle, that's pretty easy too and you wouldn't have to do it unless you wanted an easy way to let someone change their preference later.

Besides all that, I think everyone agrees with you that Apple should make it possible to do it at a system level. The simplest way to do this in my opinion would be to allow users to remove pre-installed apps if there is an alternative on the device. For instance, if I have an app that responds to "http:// URLs, allow Safari to be removed.

2 comments

I guess my point was, without a settings option to re-set this, it's an incomplete feature. It works for a very narrow scenario, but not for the vast diversity of scenarios that the real world will bring. For instance, your code has a fairly large bug... if the user sets chrome as the default, then at some later point they delete chrome, it won't open urls anymore.

I would definitely encourage you to polish up that gist into some kind of easily incorporated module (a category on UIApplication, perhaps?)... the more people who start doing this sort of thing, the more pressure there will be on Apple to enable this the "right" way.

Polishing it up as a category is a good idea; I might do that tomorrow. But yeah, the point of all this is that you can't set a default browser in iOS.
Along with that allow chrome to run its own game-not require it to use the underlying web rendering thing.