VGTech is a blog where the developers and devops of Norways most visited website share code and tricks of the trade… Read more

Are you brilliant? We're hiring. Read more



Xcode Plugins


If you haven’t done so already it’s time to check out some Xcode plugins. How about managing cocoapods from inside Xcode or getting a Todo-list window generated from your code comments? Clang-formatting your code, install new colorthemes or getting a minimap-view like in Sublime text? (more…)

VG+ 2.0: From Native to Hybrid App.


VG+ is VG’s premium subscription based digital product and VG’s third editorial product, it consists of the best content from the printed VG newspaper with the best content from VG’s free news site Context aware content tailor made for each platform ensures the ideal reading experience per device. The user can quickly and easily gain news insight on their mobile while enjoying a more immersive experience on the iPad.


The first version of VG+ was released in 2011 as an iPad app. It was a native application that won multiple awards including the ‘Best iPad Newspaper in the world’ at the WAN IFRA Cross Media Awards in 2011.

In 2013 we ditched our native apps and created a new set of VG+ Hybrid Apps (Android, iPhone and iPad). The goal was to combine the best of web technology with the best of native technology. We also created a new set of editorial tools that are tailor made to the needs of our editorial team and to creating interactive and instantly available content for mobile devices.

So why did we scrap the native apps and build hybrid apps?


iOS7-bug: Shows white page when getting 304 Not Modified from server


It seems like after Apple upgraded almost every line of code in the iPhone they also introduced a bug regarding browser cache in Safari.

If your site takes advantage of the Last-Modified or ETag headers, you will probably run into this problem as well.

The iPhone will send a If-Modified-Since or If-None-Match header. The problem appears when the page is interrupted or cancelled during loading. In this case, it seems it will store an incomplete cache entry in the browser cache.


Dissecting Javascript clicks in UIWebView


In VG we make heavy use of UIWebView, almost all of our iOS apps is a mix between native code and HTML. This is nice and dandy for presenting all sorts of content – being a newspaper means tons of webpages with ads, frames, javascript menus and whatnot.

Generally this works out really well, but for a long time we had a problem with links intercepted by javascript and how to distinguish these from an iframe loading. Why would we want to do this? Sometimes we wish to load linked pages in a separate view, leaving the originating page intact. Clicking on an article on our front page will push a new webview on the navigation stack so that when you’re done reading the article you can close it and instantly go back to the same spot on the front page. We use webview’s shouldStartLoadWithRequest delegate method for this purpose, like this:

Hover state on touch devices


With an increasing number of users on tablets and smartphones, the need to take touch friendliness into consideration is greater than ever. Even though both the browsers and hardware are approaching desktop speed, there are still some issues with implementing web sites and web apps for these devices. (more…)

Vektklubb Android-app available


We recently released an Android application for – a product that helps you lose weight, stay in shape and become healthier.

The app is a simple WebView-based wrapper, but we hope this can help new and existing users discover the mobile version of the product.

You can download the application for free over on Google Play – although actually using the application requires you to have an active subscription to Vektklubb.

Speeding up SQLite insert operations


I’ve been working on an Android application recently which uses an SQLite database to store and search about 6000 rows of data, and the data is updated from a webservice periodically. It would seem like a fair assumption to think the retrieval of data from the webservice would be the slowest part of the operation, however – this turned out not to be the case. (more…)