Blog

show all ·  general swift swiftui guest-article ·  ai android animations api appkit apps ar archive async authentication automation ci closed-source cocoapods codable colors conference conferences css dates device di docc document-scanner documentation documentgroup dotnet environment-values error-handling extensions fastlane gamedev geo gestures git github html iap image-renderer images indie ioc ios javascript jekyll keyboard keychain licenses lint localization macos mapkit ml mocking multi-platform ndepend objc open-ai open-source pasteboard php presentation-detents property-wrappers protocols quick-look realm rich-text scrollview searchable sf-symbols sheet slugify spm storekit subscriptions sunset swiftgen swiftui-presentation tagging testing tvos typography uikit url-encode video vr watchos web webview xcode

Reflections on failing to reach out

Nov 8, 2023 general

My last month has been all about wrapping up and releasing a brand new major version of KeyboardKit. It has been a fun project…but failed to deliver on all the work that went into it.

Cleaner grid initialization in SwiftUI

Aug 29, 2023 swiftui

SwiftUI’s LazyVGrid and LazyHGrid are great for creating flexible grids. I however always find myself struggling with their initialization and have therefore created some utilities.

SwiftUI Prefers Semantics

Jun 15, 2023 swiftuiopen-source

SwiftUI get amazing updates every year. If you however have to support old OS versions, you may be unable to use the new tools, or jump through hoops to make it work.

DeckKit Updates

Jun 13, 2023 swiftuiopen-source

DeckKit 0.7 is out, with new shuffle support that makes shuffling a deck enjoyable. Let’s take a look at what’s new in this minor update.

SwiftUIKit Updates

Jun 12, 2023 swiftuiopen-source

SwiftUIKit 3.3 is out with some additions, like support for using Codable with AppStorage and SceneStorage, as well as new list utils. Let’s take a look at what’s new in this update.

Vision Pro - so many questions

Jun 5, 2023 general

Apple Vision Pro is finally unveiled! As a surprise to no one, it looks spectacular. However, for every rumor and question addressed today, new ones arised.

An App Group roller coaster ride

May 17, 2023 swiftswiftui

I’ve been struggling with a random bug when using an App Group to sync data between an app and a keyboard extension. The explanation: a combination of human error and Xcode.

Deep Dish Swift - Day 3

May 2, 2023 conference

Deep Dish Swift flew by and suddenly, the third and final day was here…way to soon. I’m impressed by the scale of this first edition, and hope there will be a second one next year.

Deep Dish Swift - Day 2

May 1, 2023 conference

Deep Dish Swift Day 1 was one afternoon filled with amazing talks and getting the chance to meet many people from the community. Let’s get Day 2 going.

Deep Dish Swift - Day 1

Apr 30, 2023 conference

2023 flew by and Deep Dish Swift suddenly happened! This is a summary of the first indie dev day. The talks are not recorded, so invite the speakers to your conference.

Sort git tags like a pro

Mar 26, 2023 git

If you like me use semantic versioning and have projects with a gazillion version tags, it’s nice to be able sort the tags in various ways. Let’s see how to sort Git tags like a pro.

Introducing LicenseKit

Nov 9, 2022 swiftclosed-sourcelicenses

When building closed-source software, you must protect your source code as well as the binaries themselves. One way to do this is with software licenses. This is why I’m excited to introduce LicenseKit - an SDK that protects your software with commercial licenses.

Using QuickLook in SwiftUI

Jun 27, 2022 swiftuiquick-look

SwiftUI is growing with every release, but there are still old treasures to be found in various frameworks, that aren’t part of core SwiftUI. Let’s take a quick look at QuickLook!

Slugify a string

May 30, 2022 swiftslugifytagging

In this post, we’ll take a quick look at how to slugify a string in Swift, which is nice if you want to generate tags, web urls etc.

Detecting SwiftUI's preview mode

May 27, 2022 swiftui

In this article, we’ll take a look at how to determine if code is running in a SwiftUI preview, which may be nice if you need to disable certain things, like network calls.

Git tags cheat sheet

Aug 26, 2021 git

In this post, let’s look at some git commands that I find useful. The post is primarily meant for future reference for myself, but can hopefully be useful to others as well.

Swift Semantics

Oct 16, 2020 swift

In this post, we’ll look at various ways to improve readability of Swift code, by introducing a couple of extensions to Swift’s native types.

SPM .gitignore excludes Xcode projects

Jan 2, 2020 spmxcode

When you create Swift Packages with swift package init, the default .gitignore excludes Xcode projects. This will cause problems if you later add an Xcode project to the package.

Generic Swift protocols

Apr 5, 2019 swiftprotocols

For years, I’ve been struggling with combining generics and protocols in Swift. In this post, I’ll describe how I finally made sense of it all.

git grep

Mar 11, 2019 git

This is a short note to my future self on how to use git grep instead of grep to find all occurrences of a certain text in all files within a git repository folder.

Using structs like enums in Swift

Jan 30, 2019 swift

Swift enum and struct are two powerful tools. In this post, I’ll discuss how you typically use them, and how you can use structs like enums when you need more flexibility.

iPad Pro production setup

Dec 28, 2018 gitgithubjekyll

In this post, I’ll write about findung a more flexible setup for my various sites, projects, blog etc. I’ll descibe how I moved away from my old hosting provider and Wordpress and found a setup that lets me create content on my iPad Pro.

Alamofire + AlamofireObjectMapper

Dec 27, 2018 swiftrealm

This is an updated version of a talk I gave at CocoaHeads Sthlm in 2017, on how to use Alamofire to talk with an api, AlamofireObjectMapper to map responses, the Alamofire RequestRetrier to retry failing requests and the RequestAdapter to adapt all requests.

Automate setting up macOS

Aug 26, 2018 automationmacos

In this post, I’ll describe how to automate setting up a new Mac with a terminal script that will install system software and applications, configure the computer etc. in mere minutes.

Codable magic

Feb 15, 2018 swiftcodable

I have finally started replacing NSCoding types in my code with the new Codable protocol. This article covers things that I’ve learned along the way.

Ditching RxSwift

Jan 19, 2018 swift

After hearing many good things about RxSwift, I decided to use it in an app. However, after struggling with it for months, I haven’t found a nice setup and have now decided to ditch it.

Using iPad Pro with Working Copy

Nov 5, 2017 iosgit

In this post, I will write about my experience using Working Copy on my iPad Pro, adding a blog post to a Jekyll-powered blog, then pushing the result to GitHub.

New year, new habits

Jan 23, 2017 gitjekyll

I finally made it! After years of “I really should”, I have finally left my old hosting provider, move all my sites to GitHub and start with some nice new habits for the new year.

Reset Xcode load plugin bundles warning

Sep 5, 2016 xcode

I accidentally clicked “Skip Bundles” instead of “Load Bundles” when I started Xcode after adding new plugins. This causes Xcode to not load plugins. How can we fix this?

Using Swift protocols in Objective-C

Sep 3, 2014 swiftdi

I’m currently creating two games for iOS. One is made in Swift & SpriteKit, while one is in Objective-C & UIKit. I now want to share logic by using my Swift protocols in Objective-C.

Scaling mobile at Spotify

Nov 6, 2013 conferences

This is a sum-up of a talk I attended at Øredev 2013, where Mattias Björnheden and Per Eckerdal from Spotify talked about how Spotify scaled their mobile teams.

Memory leak in iOS when mixing ARC and non-ARC code

Sep 10, 2013 ios

I had an iOS app crash after taking a few photos. The stack trace showed a memory leak, but I had a hard time finding it. Turns out that it was caused by mixing ARC and non-ARC. When I tried reproducing it, I launched Instruments to see how the app allocates memory. I started taking photos, editing them, but didn’t encounter a memory leak…until I did.

Auto-increment Build Number in Xcode

Aug 23, 2013 xcode

When I released new version of iOS apps, I used to manually update the build number. It is however better to let Xcode do it automatically. Let’s take a look at how to do it.

Android Activity Lifecycle Car Analogy

Aug 5, 2013 android

In most application frameworks, classes have a lifecycle that is used to do customizations at the proper time. Let’s look at the Android activity lifecycle compared to a car.

Android Assets for Various Screen densities

Aug 2, 2013 android

Android devices come in many different flavors compared to iPhone devices. They can be slow, fast, crappy, great, low-res and ultra-hd. To best honor the device running your app, you should provide assets for various screen densities.

Android Fullscreen Activity

Aug 2, 2013 android

The best way for me to learn, is to write about it. This way, I can return to earlier posts and see that I knew nothing once, and that I have learned a few things. Today, I will honor that strategy by publishing a simple class that can be used for fullscreen Android activities.

Run Lint in Android Studio

Jul 31, 2013 androidlint

As I just started learning Android, I was happy to see that linting is such an integral part of the development process. Let’s see how to set it up in Android Studio.

Android Glossary

Jul 31, 2013 android

I’m currently getting started with Android development, which means that I have many new things to learn. The biggest challenge with learning a new language is not the syntax itself, but the tools and conventions. Let’s look at some acronyms that are worth remembering.

Windows 8 Activation Fail

Jun 7, 2013 archive

Unlike Apple’s great OS X onboarding experience, The Windows onboarding is horrible. If you charge money to use your OS, activation must work. Too bad, it doesn’t.

Multiple SSH Files

Jun 7, 2013 git

When working with git, I use a single SSH key pair for GitHub, GitLab, etc. Today, though, I had to add a second key pair to be able to clone another remote repository.

New legal label in MKMapView

Apr 15, 2013 iosgeo

I used Google Maps in some of iOS apps, until Apple launched their own map engine. So, now I use Apple Maps. And it adds an annoying little label. Damn.

Natural Scrolling in Windows 8

Nov 29, 2012 archive

Apple introduced natural scrolling in OS X Lion, which makes the scroll content move as if it was a sheet of paper that you press and dragged around with your finger.

Oredev 2012 - Day 2

Nov 12, 2012 conferences

My second day at Øredev 2012 was amazing! When it was over, I had to sit down and take it all in. There were so many great talks, and I still had to skip many that I wanted to see.

Øredev 2012 - Day 1

Nov 7, 2012 conferences

I am happy to once again attend Øredev in Malmö, Sweden. Three days with great talks and nice friends is just what is needed in the dark, Swedish November.

iOS Bounce Animation

Sep 3, 2012 archiveanimations

I have an app where tapping various icons bounces the icon, plays a sound and takes the user to another part of the app. Let’s see how the bounce animation was made.

CLGeocoder fails silently

Aug 8, 2012 archivegeo

I’m currently developing a location-based app for iPad and iPhone, that will allow users to store locations and use custom icons and colors for the pins.

JSON in iOS

Jul 4, 2012 archive

Working with JSON is easy in iOS 5, since there’s now a great, native JSON serializer and deserializer that handles everything for you.

Adding photos to the iPhone simulator

Mar 13, 2012 archiveios

I’m building an iOS app that makes use of the device camera. It works well, but since I’m also using the simulator, I want to be able to select pictures from the photo library as well.

Tweaking NDepend CQL rules

Oct 6, 2011 ndepend

After learning how to automate and schedule NDepend to run for several solutions at once and starting to use NDepend more regularly, the power of CQL has grown on me.

EditorBlockFor HTML helper

Aug 28, 2011 archive

In ASP.NET MVC, Microsoft has created various HTML helpers that can be used in a form, e.g. LabelFor, EditorFor, ValidationMessageFor. Let’s see how to create a custom one.

Slow iMac about to be fixed?

May 12, 2011 macos

I have been having big problems with my iMac 27″ (4GB RAM) that runs Windows 7 on a Boot Camp Partition (using VMWare Fusion), where it writes constantly and is super slow.

Custom ASP.NET validation attributes

Mar 23, 2011 archive

ASP.NET validation attributes is a great way to validate C# properties in different ways, both client & server side. Let’s look at how we can create our own validation attributes.

Trying out Plupload

Feb 2, 2011 web

The team behind Tiny MCE has created a great upload component called Plupload that supports many runtimes, such as from jQuery-based HTML uploads, Flash, Silverlight, etc.

Adding Spark to ASP.NET MVC 2

Jan 13, 2011 archive

I finally got some time to look at the Spark View Engine. Since the Razor View Engine will be shipped with ASP.NET MVC 3, I decided to give it a try.

HTML5 localstorage

Dec 9, 2010 javascript

I have spent some time experimenting with the new HTML 5 localStorage feature, which simplifies storing data in browser storage using JavaScript.

PHP magic quotes

Nov 24, 2010 php

I’ve had problems when sending data to a PHP page, using AJAX. To unpack the data, I had to use stripslashes. It seemed to work, and I was happy, until the world exploded.

NuPack - a quick walkthrough

Oct 8, 2010 dotnet

NuPack is a free, open source, developer-focused package manager for .NET. It looks great, so I downloaded it and gave it a try. Let’s have a look at how to use it.

Getting started with NDepend 3

Oct 7, 2010 ndepend

I have finally got my thumb out and added an NDepend project to one of my hobby project solution, to get some analyzing done. Let’s have a look!

Fonts.com web fonts

Sep 21, 2010 typographycssweb

The time has finally come to throw Arial and Verdana into the trash (Helvetica can stay), as Monotype, Linotype & ITC have teamed up to develop a really cool service - web fonts!

Using Moq with NUnit

Aug 19, 2009 testing

As I continue to work with unit tests, I have noticed that some of my development patterns have started to change…for the better.

Using themes in ASP.NET MVC

Aug 19, 2009 archive

I’m building a web site with ASP.NET MVC. After looking at the nice examples, I noticed that CSS files were manually included in the master page. Let’s use themes instead.

Identifying the project root in PHP

May 15, 2009 archive

I currently have problems with identifying the project root in a PHP project. The problem applies to PHP, but is general and applies to other languages and environments as well.

Twitter vs Jaiku

Apr 17, 2009 general

I’ve been trying out Twitter and Jaiku for a while now. Since both provide more or less the same set of features, I have evaluated which I think will best fit my needs going forward.

Avoid empty img src values

Jan 26, 2009 htmlweb

In this post, we’ll discuss how empty image src values can ruin the performance of a web site, and how you can to solve it.