200 grams of stinging nettle that Stani is going to make into a soup.

200 grams of stinging nettle that Stani is going to make into a soup.

Painting eggs for Easter. Tomorrow we will fight with them.

Painting eggs for Easter. Tomorrow we will fight with them.

Thor: Ragnarök look like a bucket of fun. Really looking forward to this one.

Totally knackered after my trip to Copenhagen, but it was a very good trip, lots of fun.

Totally knackered after my trip to Copenhagen, but it was a very good trip, lots of fun.

Pub quiz night. Doing good with 21.5 points out of 30.

Pub quiz night. Doing good with 21.5 points out of 30.

On our way to Hamburg for the weekend. Gonna be nice.

On our way to Hamburg for the weekend. Gonna be nice.

Instead of buying a new windows machine that I ultimately don’t need I’m now testing if I really need a laptop by going iPhone only for a few days.

Am seriously thinking about buying a Windows laptop. I’m finding Windows 10 to be a very interesting OS right now, much more then macOS.

Hey kitty, how you like the swing and bass music?

Hey kitty, how you like the swing and bass music?

Got my BeatsX yesterday. Ran with them once already using the wingtips and they stayed in quite well. Now using them at work without the wings and they are staying in pretty good as well. The sound is nice, though I haven’t put them though their paces just yet.

Selective rotation lock in iOS apps with Swift

A guide on how to implement selective rotation lock on iOS apps

Start by enabling Portrait, Landscape left and right orientation in your app settings.

In your AppDelagate.swift add:

var enableAllOrientation = false

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { if (enableAllOrientation == true){ return UIInterfaceOrientationMask.allButUpsideDown } return UIInterfaceOrientationMask.portrait }

This sets your app to not rotate by default.
Then in your controller that you want to allow to rotate add:

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    appDelegate.enableAllOrientation = true
}

override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated)

let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.enableAllOrientation = false

let value = UIInterfaceOrientation.portrait.rawValue
UIDevice.current.setValue(value, forKey: "orientation")

}

This will enable rotation on the controller and then disable it again when you leave the controller and make the app rotate back to portrait mode.
You can easily make the app do the opposite by setting enableAllOrientation to true from the start and then swap the code in viewWillAppear and viewWillDisappear, basically forcing that single view to be in portrait, or any other orientation you want.

All of this was taken from these two answers to this question on Stack Overflow.

Sunset over Eyjafjörður. The place I grew up in.

Waiting for our train to Deva. Taking a train here in Romania will be some kind of an adventure I think. It is very hot here, 31 °C as I wrote this, thankfully we found a restaurant with air conditioning and beer in big bottles. Took awhile, Timisoara has almost no restaurants around Gara de Nord but they are drowning in bakeries and pharmacies. (at Timișoara Nord railway station)

Waiting for our flight to Charleroi, where we will lunch and then fly onwards to Timisoara. From Timisoara we will then take a bus to Deva. 🛫🛬🍱🛫🛬🚌🏨😴 (at Copenhagen Airport (CPH))

The building of the wall has started at my new refuge. #thewall #ismaf

The sun is out and it’s relatively warm this morning.

So, I went to Iceland in November 2015 to make some art with my friends in Æla. One of the concerts was at the Kex Hostel and it was recorded (and live streamed) by KEXP. Now they have shared the full performance on YouTube.
I’m the person wearing the horsehead among other items of clothing. Not on stage the whole time, and I get naked in the end so mostly SFW.

Festelavn buns at work today. I find it odd that Danes call those things in the front and back there buns. Look more like Spandauer really. (at Valtech)