In this post, we’ll take a look at how to customize the macOS about panel for a SwiftUI app, to let us show custom content.
In this post, we’ll take a look at how to customize the macOS menu bar for a SwiftUI app, using SwiftUI tools like
I am about to create a new major version of SwiftUIKit. This version will remove no longer needed things, bump the deployment targets and merge the library with SwiftKit.
My last month has been all about wrapping up and releasing a brand new major version of KeyboardKit. It’s been a very fun project…that unfortunately has failed to deliver on all the work that went into it.
While a single line
TextField will automatically dismiss the keyboard when you press return, the same is not true for multiline text fields. Lets take a look at how to fix this.
List component allows users to drag to reorder items within the list, the
LazyHStack components currently lack this functionality. Let’s take a look at how to implement it from scratch.
LazyHGrid are great for creating powerful and flexible grids, but I always struggle with how to define columns when creating them. I’ve therefore created some extensions to make this easier. Let’s take a look.
If you’ved added a
Menu with an icon
Label to a
List, you may have noticed that the separator line behaves unlike other items, and starts below the icon instead of the title. Let’s find a way to fix this.
SwiftUI keeps evolving, but there are still some things that we have to write custom code for. Today, let’s see how we can extend
Codable to make it possible to persist it in
Lunchrrrrr has been rewritten for iOS 16. It has an updated and cleaner UI, as well as an improved card drag responsiveness.
SwiftUIKit 3.4 is out, with new color and color picker tools, new list components, an optional binding and new view styles.
SwiftUI receives amazing updates every year. If you however have to support old OS versions, you may be unable to use the new tools for some years, or jump through hoops to make it work. In this post, let’s look at a semantic approach to use new, non-critical features in apps that targets old OS versions.
DeckKit 0.7 is out, with a new shuffle animation that makes shuffling a deck very enjoyable. Let’s take a look at what’s new in this minor update.
SwiftUIKit 3.3 is out! It has some nice additions and changes, like more tools for using
AppStorage and new list utils. Let’s take a look at what’s new in this minor update.
Apple Vision Pro is finally unveiled! As a surprise to no one, it looks absolutely spectacular. However, for every rumor and question that were addressed today, new ones arised, leaving me very confused.
After a long time away from the project, I finally had some time to revisit RichTextKit and add some new features, like indentation support and grouped controls.
The same way SwiftUI buttons can be given a
.bordered button style to apply a nice, round border, you can use
ControlGroup to group several buttons together in a bordered group. Let’s look at how.
DocumentGroup-based apps make it easy to edit documents and store them on device and in the cloud. However, these apps are currently very limited when it comes to customization. Let’s look at how we can extend them.
In early 2022, I wrote an article about how to bring undimmed presentation detents to SwiftUI sheets. Since then, the original code has been improved many times and behaves a lot better than it did then.
I’ve been struggling with a very random bug when using an App Group to sync data between an app and its keyboard extension. The reason turned out to be a horrible combination of human error and Xcode.
Deep Dish Swift flew by and suggendly, the third and final day was here…way to soon. I’m impressed by the scale of this first edition of Deep Dish Swift, and really hope there will be a second installment next year. Let’s see what Day 3 had in store.
Deep Dish Swift Day 1 was one afternoon filled with amazing talks and getting the chance to meet many nice people from the community, ending with a deep dish pizza feast at Giordano’s. Let’s get Day 2 going.
2023 flew by and Deep Dish Swift suddenly happened! This is a summary of the first indie dev focused day. Since the talks are not recorded, reach out to the speakers and invite them to your conference to get more people to hear the great stories they have to tell.
Swift provides powerful ways to group and sort collections. Let’s take a look at some ways to do this and how to change the sort logic a bit.
If you like me use semver (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.
As we’ve previously looked at how to implement offset tracking and stretchable headers for SwiftUI scroll views, let’s combine them to implement a scroll view header that stretches out when you pull down and sticks to the navigation bar as you scroll.
Many iOS apps have screens where the header view stretches out when you pull down the screen. It’s a commonly used and loved component, so it’s strange that it’s not natively available in UIKit or SwiftUI. In this post, let’s look at how to implement such a header view in SwiftUI.
ScrollView is currently quite limited, and for instance doesn’t let us detect the current scroll offset. In this post, let’s look at how to add offset tracking, which we’ll then use to build fun things.
In this post, I’ll show how you can use the SystemNotificaton open-source library to mimic iOS system notifications in your SwiftUI apps.
If you are building
DocumentGroup-based apps in SwiftUI, you may have noticed that apps that worked fine in Xcode 15 now show two back buttons when being built with Xcode 16.
As we saw in last week’s post, complex gestures in a SwiftUI
ScrollView is complicated, since they can block the scrolling. However, if we don’t have a scroll view, things become a lot easier. Let’s take a look at a version of the button that we created last week, that uses a single gesture.
SwiftUI gestures are complicated, since they can block
ScrollView gestures and cause scrolling to stop working. I’ve found a way to implement rich view gestures in a way that doesn’t block the scrolling.
When building closed-source software, you must not only protect your source code, but must protect the binaries themselves as well, so that you can distribute them without having to worry that they are used by people who shouldn’t access them. One way to do this is with software licenses.
I’m about to release a brand new version of Wally, which was the first app I ever made for iOS 10+ years ago. Wally 4 has been rewritten for iOS 16 and iPadOS 16 using SwiftUI 4. This post will go through some of the things involved in this major rewrite.
I’m a bit late to this AI-based image party, but just wanted to write down some thoughts about DALL·E 2, Stable Diffusion and the new ecosystems of services that follow in their footsteps, such as PromptBase.
As I’m rewriting an old app from scratch, I’m adding a bunch of features to it. One such feature is content tagging. For reusability, I’ve put all tag-specific logic in a new library called TagKit. Let’s take a look!
As the Swedish summer keeps on delivering, I’m struggling to combine enjoying life with my family and friends with full-time work, open-source projects, a big app rewrite and this blog.
SwiftUI 4 adds a new
NavigationSplitView component that simplifies creating rich sidebar-based experiences on iPad and macOS, while automatically scaling down to a
NavigationStackView (also new) on iPhone. It’s a powerful component that however can be a bit tricky to get started with, so let’s take a look at how to use it and some ways to style it.
SwiftUI 3 added the
searchable view modifier, which makes it possible to add a search field to any view. In this post, let’s take a look at how to make this (and any other) modifier conditional.
In SwiftUI 4 and iOS 16, you will finally be able to hide the home indicator on iPhone and iPad devices that don’t have a home button, without resorting to UIKit hacks. Let’s see how.
As the Swedish summer keeps delivering sun, heat and happiness to this otherwise dark and cold part of the world, I’m going on vacation and will be back in August.
In this post, let’s take a quick look at how to resize images in UIKit and AppKit. The result will work on iOS, macOS, tvOS and watchOS and lets us resize images with the same APIs regardless of platform.
SwiftUI is growing with every new release, but there are still old treasures to be found in various Apple frameworks, that aren’t part of the core SwiftUI library. One example is
MapView in MapKit, another is the amazing
quickLookPreview view modifier in the QuickLook framework. Let’s take a quick look.
In this post, let’s take a look at StoreKitPlus, which adds extra functionality for working with StoreKit 2 and aims to make it much easier to use StoreKit in SwiftUI.
SwiftUI 4 introduces a new
ImageRenderer that can be used to render any SwiftUI view as an image in iOS 16, macOS 13, tvOS 16 and watchOS 9. Let’s look at how to backport it to iOS 13.
SwiftUI 4 adds a bunch of great features, such as custom sized sheets. However, these sheets will always dim the underlying view, even when they use a smaller size. Let’s look at how to fix this.
SwiftUI 4 introduces a new
ImageRenderer that can be used to render any SwiftUI view as an image in iOS 16, macOS 13, tvOS 16 and watchOS 9. Let’s take a quick look at how it works.
SF Symbols is an amazing iconography library, that is designed to integrate seamlessly with the various Apple platforms. SF Symbols 4 adds even more features to these symbols, where variable colors will let you communicate values with your symbols. Let’s take a look!
WWDC’22 introduced a bunch of amazing additions to SwiftUI, many of which will render many 3rd party libraries obsolete. One such addition is SwiftUI’s upcoming support for custom sheet sizes.
In this article, we’ll look at how to build a rich text editor for UIKit, AppKit and SwiftUI. We’ll extend native types to extend the foundation support for rich text, add new types to bridge the different platforms and make sure that we have a basic, working foundation that we can expand in future posts.
To all of you who have struggled with SwiftUI and slow scrolling on tvOS - happy news! With Xcode 14, SwiftUI 4 and tvOS 16, scrolling finally seems to become super smooth.
In this post, we’ll take a quick look at a better way to extend types in Swift, to make the extensions more versatile and discoverable.
In this post, we’ll take a quick look at how we can fetch images from the AppKit
NSPasteboard, which lacks a lot of functionality compared to the UIKit
In this post, we’ll take a look at how we can get colors, images and other assets that are defined in Swift packages to work in external SwiftUI previews, such as in an app.
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.
In this post, we’ll take a quick look at how to determine if code is running as a SwiftUI preview or not.
In this post, we’ll take a quick look at how to generate a random color in SwiftUI, using the nice random api:s provided in Swift.
In this post, we’ll take a look at how to create a custom SwiftUI environment key that lets us get the safe area insets for the current scene.
SwiftUI is amazing, but has a history of seriously buggy behavior. Even if you follow the documentation and your code compiles, you must still verify that it actually works if you target older iOS versions. As an example, let’s take a look at using the
isEnabled environment value with custom button styles.
Swift packages is an easy and powerful tool for separating your code into modules. However, Xcode currently shows a
linking against a dylib which is not safe for use in application extensions warning when linking targets and packages in certain ways, even though a package is safe for use in application extensions. Let’s look at how we can fix this warning.
DocumentGroup makes it super-easy to create document-based apps. However, the api:s are currently very limited, which means that even the most basic things are hard to achieve. In this post, let’s take a quick look at how we can present custom SwiftUI views as modals from a
In this post, we’ll take a quick look at how to create a property wrapper that can be used with
Codable, that automatically persists its value in
UserDefaults and updates SwiftUI when its value changes.
In this post, let’s take a look at how to schedule a website with GitHub Actions, so that we can create future content that is automatically published at the intended publish date.
In this post, let’s take a quick look at how to we can extend SwiftUI with a document scanner, that uses the device camera to scan documents in iOS.
In this post, let’s take a quick look at how to we can extend the UIKit, AppKit and SwiftUI colors with hex-based initializers that accept strings (e.g.
"#abcdef") and numeric values (e.g.
In this post, let’s take a look at how to handle async errors in a flexible and scalable way in SwiftUI. We’ll cover both completion block- and async/await-based use cases.
In this post, let’s take a quick look at how to link DocC to types that have the same name as the target they belong to.
In this post, let’s take a look at how to extend the
LocalAuthentication framework with an
async way to perform local authentication.
DocC is an amazing tool for writing and generating documentation for Swift-based projects. This post will discuss how to generate multi-platform documentation with DocC, using Terminal scripts and Fastlane.
SwiftUI’s amazing multi-platform support makes it easy to develop apps for iOS, macOS, tvOS and watchOS. But how do you handle types that differ between platforms? Let’s take a look.
SwiftUI currently has no WebView, which means that we have to create it for ourselves. Let’s see how we can easily build a multi-platform web view for iOS, iPadOS and macOS.
I absolutely love my brand new 14” M1 MacBook Pro, but there are architectural problems when working with Swift packages and XCFramework builds. In this post, I’ll describe some problems…and solutions.
In this post, I’ll discuss my experiences of working on various open-source projects, some of the steps and processes involved as well as some learnings.
In this post, I’ll discuss the development of my new KeyboardKit app for iOS and iPadOS. I’ll go through my original vision, the actual outcome as well as a bunch of findings, problems etc.
In this post, I’ll list a couple of git commands that I found useful when cleaning up an unstructured git tag history. The post is primarily meant for future reference, but if you find it useful, that’s great.
In this post, we’ll look at how to distribute closed-source XCFrameworks-based products with the Swift Package Manager (SPM). The post goes through project setup, package distribution and how to solve some problems along the way.
In this post, let’s look at a solution to the
the server ssh fingerprint failed to verify error that may bite you when you add an SPM dependency to an app from a private server over SSH.
In this post, I’ll demonstrate how to use MockingKit to create dynamic mocks of protocols and classes, that let you record and inspect function calls in your unit tests, register conditional returns, etc.
This is a follow-up post to this previous blog post, where I discussed my experiences with building a video streaming app for tvOS, using SwiftUI. This post will discuss how I ported the app to iOS.
In this post, I’ll discuss how I built a movie-streaming app for tvOS in SwiftUI, for the Swedish streaming service Cineasterna, which lets people stream videos using their public library card.
In this post, we’ll look at an easier way to manage full screen covers in SwiftUI, in a way that lets us reuse functionality, reduce state management and present many different covers with the same modifier.
In this post, we’ll look at a way to validate app localizations and integrate it into Fastlane and any CI tools and processes that you may have in place.
In this post, we’ll look at various ways to improve readability and writeability of Swift code by introducing extensions to Swift’s native types.
In this post, we’ll look at an easier way to manage alerts in SwiftUI, in a way that lets us reuse functionality, reduce state management and present many different alerts with the same modifier.
In this post, we’ll look at an easier way to manage sheets in SwiftUI, in a way that lets us reuse functionality, reduce state management and present many different sheets with the same modifier.
In this post, we’ll look at how to uniquely identify the current device. We’ll also look at different ways of persisting the unique identifier to make it available even if the app is uninstalled.
In this post, we’ll look at how to read from and write to the keychain on iOS devices. We’ll look at a great library for this and how we can make it more abstract.
In this post, we’ll look at how to url encode strings. We’ll then create an extension that let’s us do this easier and with less code.
In this post, we’ll discuss how to replace all occurences of a string within another string. We’ll then create an extension that allows for easier case-sensitive replacements.
In this post, we’ll look at how to check if a string contains another string. We’ll then create an extension that allows for easier case-insensitive checks.
In this post, we’ll discuss how to Base64 encode and decode strings in Swift. We’ll also create a couple of extensions to make this easier to use and more readable.
In this post, we’ll create string representations of numeric types in Swift and extend these types with convenience functionality to make them easier to use.
In this post, we’ll extend
Result with extensions that make using it easier in certain situations.
In this post, we’ll look at how
DispatchQueue can be used to delay and chain operations. We’ll also extend it with convenient functions that simplify these tasks.
In this post, we’ll extend
Date with functions that let us compare dates with clean, readable code.
In this post, we’ll extend
Date with functions that let us add and remove seconds, minutes, hours and days to a date.
In this post, we’ll look at the basics of Inversion of Control (IoC) and Dependency Injection and how to reduce coupling within your codebase.
In this post, we’ll look at how to perform local biometric user authentication with FaceID or TouchID on Apple’s various platforms, using the
SwiftUI is great for building declarative user interfaces. However, it’s still young and lacks many common things. In this post, we’ll look at a way to read geometry information from any view in a view hierarchy.
SwiftUI and Combine makes it easy to build apps for watchOS. However, if the app is part of a larger system, you may have to adjust your architecture. In this post, we’ll take a look at the work involved in building a SwiftUI/Combine-based app for Apple Watch.
Presenting UIKit view controllers in SwiftUI is simple, but things become more complicated when they communicate through delegation. In this post, we’ll look at a way to solve this.
In this post, we’ll create a package for the Swift Package Manager. The result will be a package that adds more gestures to SwiftUI.
When you create Swift Packages with
swift package init, the generated .gitignore will exclude all Xcode projects by default. This will cause problems if you later add an Xcode project to your package.
If you use
swift package generate-xcodeproj to generate an Xcode project for a SPM package, App Store will reject any apps that adds this library with Carthage. This post will show you how to make App Store submission work.
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.
I love Swift’s type system and its extension model, but you have to use it with care. In this short post, I discuss how to keep your extensions from being exposed everywhere.
This is a short note to self about how to use
git grep instead of
grep to find all occurrences of a certain text in all files within a root folder.
struct are two powerful tools. In this post, I’ll discuss how you typically use them and how to use structs like enums when you need more flexibility.
Swift is an amazing language, but currently lacks good support for coordinating async operations in a sophisticated way. In this post, I will look at existing libraries for solving this, then discuss a lightweight alternative that uses a couple of simple protocols and implementations.
In this post, I’ll write about my process to find a more productive and 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.
This is an updated version of a talk I gave at CocoaHeads Sthlm in 2017, on how to use Alamofire to communcate with an api, AlamofireObjectMapper to map responses, the Alamofire
RequestRetrier to automatically retry failing requests and the
RequestAdapter to adapt all requests. I also demonstrated how to use Realm to seamlessly add offline support, using the decorator pattern.
In this post, I will show how to reduce the amount of code you have to type when
testing enums, by using the new
In this post, I will show how to automate setting up Xcode using
Fastlane in a way that is easy to extend if you need to automate more later on.
After installing Xcode 10 yesterday, I started migrating some libraries to Swift
4.2. While most migrations were painless, one failed, since it depends on
SwiftyDropbox which doesn’t support Swift 4.2.
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. This lets you setup a new Mac in minutes.
I have finally started replacing all
NSCoding objects in my code with the new
Codable protocol. This article covers things that I’ve learned along the way.
In a project that I’m currently working on, I want to redesign how we extend protocol-based domain models. However, what first looked east turned into a Swift nightmare, with problems that I’m still struggling with.
In my previous post, I wrote about how I don’t like iOS delegates and target/selectors and how I prefer to use closures. Let’s see how we can use closures with gesture recognizers, to make things nicer.
After hearing so many good things about RxSwift, I decided to use it in an app of mine. However, after struggling with it for months, I still haven’t found a nice setup and have now decided to ditch it.
Tonight, I finally sat down with my oldest daughter Cornelia, to play with Swift Playgrounds and try to teach her a bit about programming.
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.
This post will show you how to apply the
UITextField placeholder behavior to a
UITextView, which natively lacks this support.
This is a summary of my talk at CocoaHeads Sthlm, April 3 2017, where I talked about using Alamofire, AlamofireObjectMapper and Realm to talk to an api, map its responses, retry and adapt requests and then use Realm to create offline support layer by persisting data locally.
I’m really looking forward to an event at tretton17 next week, where Jimmy Engström will demonstrate the awesome Microsoft Hololens.
After procrastinating for too long, I finally spent a minute to setup git autocomplete in the Terminal. The original discussion on this topic is found here.
I finally made it! After years and years of “I really should”, I have finally managed to abandon my old hosting provider, move all my sites to GitHub and start with some nice new habits for the new year.
In an iOS project that I’m currently working on, I load images asynchronously into an
UIImageView. Although the images are properly fetched, they are pixelated once they
are added to the image view.
Today, I accidentally clicked “Skip Bundles” instead of “Load Bundles” when I started Xcode after adding new plugins. This cause Xcode to not load the plugins on subsequent launches. How can we fix this?
I have been playing around with .NET Core since the early betas, but since I do so with rather long times in between, things break each time I pick up from where I left it. Here are some notes to self.
In an Ionic 2 app that I’m building for iOS and Android, I want to use different application settings for different build configurations. Let’s see how this can be achieved in Ionic 2.
With the release of Visual Studio Code 1.0, I upgraded .NET Core to the latest version. However, the older version wasn’t properly replaced, which did cause Visual Studio Code to behave quite strange.
I’m currently developing a console app in .NET Core on my Mac. It’s a rather nice experience, although I miss a lot of stuff from Visual Studio, e.g. build triggers. Let’s make DNX reload whenever a file changes.
After so much waiting, so many “I’ll do this first”, so much app coding etc. etc. (yep, I blame my family as well), I finally managed to start playing around with DNX and ASP.NET 5.
I’m building a map app where users can save personalized content and present it
with custom pins, icons, colors etc. I therefore need to update how an
is presented and its title.
After some time away from .NET, ASP.NET and WebApi, I’m having a great time when setting up a new WebApi solution for a project at work.
I’m currently building my very first app with Ionic Framework. So far, Ionic is
fast to setup and performs well, but I just ran into a problem that forces me to
sudo for all Ionic and Cordova commands.
After upgrading to Xcode 6.3.1, I get an error that says
"Invalid Signature. Code object is not signed at all". Let’s look at what
this is and how to fix it.
I’m currently porting some iOS games from Objective-C to Swift. While doing this, I stumbled upon something interesting in how Swift handles return statements and new lines.
Inversion of Control and Dependency Injection are hot topics in the .NET world. They are however rare in the iOS community, despite being powerful tools. Let’s look at a way to setup IoC in iOS.
I’m currently creating two new games for iOS. One is made in Swift and SpriteKit, while the other is made in Objective-C and UIKit. To share logic, I need to use Swift protocols in my Objective-C code.
In this post, let’s look at how to use Crittercism to let your iOS or Android users report bugs and provide you with automated crash reports.
I use Parallels Desktop to run Windows from a dedicated OS X partition. It works great overall, but one thing that I have had problems with, is that the mouse scroll sensitivity is too sensitive in Windows. Let’s see how to fix this in Parallels.
Oh, my GOD, I wasn’t prepared for this! Matthew McCollough from GitHub made my day with this amazing Øredev 2013 keynote, leaving me tumbled in the hotel lobby for a good while afterwards.
The creativity evangelist Denise Jacobs coaches people in the tech field through creativity. In her Øredev 2013 keynote, she talked about creativity, betterness and habits.
This great Øredev 2013 session focused on how to be secure on a mobile platform, with a bunch of great examples and concrete demos.
This Øredev 2013 session was a masterpiece, where Shay Friedman blasted through 30 NuGet packages in 50 minutes.
This Øredev 2013 session was all about the new Ubuntu Mobile platform, which I’m very excited over, despite not being a Linux or Ubuntu guy. It looks very promising.
This Øredev 2013 session was a case study from Sirius International Jon Gyllenswärd and Jimmy Nilsson from factor 10 talked about a two year long change process they managed together.
This Øredev 2013 session focused on mob programming, where the entire team works together on implementing changes and new features.
This Øredev 2013 session was interesting and required a lot of attention, which made it hard for me to sum it up properly. However, I will do my best.
In this Øredev 2013 session, Christian Horsdal talked about layers, careful to distinguish between layers (logical) and tiers (physical).
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.
This is a sum-up of a talk I attended at Øredev 2013. This year, I will create a separate post for each session, instead of having multiple sessions in each post.
A really useful tool that is never top of mind for me when automating a workflow, is the native OS X application Automator.
This post is dedicated to complaining about the Bash syntax from a n00b perspective. It’s just a rant. Don’t take it too seriously.
In an iOS app of mine, I had a situation where the app shut down after taking a couple of photos. The crash reports suggested a memory leak, but I had a hard time reproducing it. Turns out the leak was caused by mixing ARC and non-ARC code.
Languages like Java and C# let you override and hide the default constructors of a class, to ensure that developers can only create valid instances of it. Let’s take a look at how to do the same in Objective-C.
When releasing new version of my iOS apps, I used to manually update the build number. However, a better approach is to have Xcode do it automatically. Let’s take a look at how to do it.
In most application frameworks, classes have a certain lifecycle that may be used to do customizations at the proper time. Let’s look at the Android activity lifecycle as compared to being a car.
My getting-to-know-and-to-love Android journey continues, and has now come to themes. This morning, I have been learning how to use themes to customize the action bar and remove its icon and title.
Android devices come in a great deal of different flavors when 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.
The best way for me to get my act together when learning new things, is to write about it as early as possible. This way, I can return to my earlier posts and verify that I knew nothing once, and that I hopefully have learned a few thing along the way. Today, I thought that I should honor this strategy, by publishing a simple base class that can be used for fullscreen Android activities.
As I have just started learning Android, I was happy to see that linting is such an integral part of the Android development process. Let’s see how to set it up in Android Studio.
I’m currently getting started with Android development, which means that I have a lot of new stuff to memorize. It’s so obvious that 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.
I’m currently getting started with Android Development. Today, let’s take a look at how to enable USB debugging on Android devices, which I had some problems with.
Unlike Apple’s outstanding OS X onboarding experience, Microsoft really have to step up the Windows onboarding. When you charge a lot of money for people to use your OS and require them to activate it, the activation must work. Sadly, it doesn’t.
When working with git, I use a single SSH key pair, which I use for e.g. GitHub. Today, though, I had to add a second key pair to be able to clone another remote repository.
If you want your apps to have their own identity, you should put time into adjusting its appearance, such as fonts and iconography. One thing that may be tricky, though, is to replace the default back button with a custom one. It should be simple, but I just can’t get it to work in one app.
I’m using Google Maps in a couple of iOS apps. Or, at least I was before Apple replaced Google Maps with their own engine. So, now I guess I use Apple Maps. And Apple Maps adds an annoying little label.
In a current project, we are auto-creating deploy packages of an ASP.NET MVC web site, using Team City. When we do, we need to perform web.config transformations to ensure that a properly configured file ends up in the deployed package.
I’m working on an iOS app that is powered by an ASP.NET MVC 4 backend that uses Entity Framework Code First with auto migrations and runs on App Harbor. We also have a web site that is used to present more information. This is how we put it all together.
In OS X Lion, Apple introduced
natural scrolling. It means that when you scroll,
the scrollable content will move around like it was a sheet of paper you pressed
and dragged around with your finger.
I recently updated OS X Lion to OS X Mountain Lion on all my personal computers. The installation was smooth, but afterwards some things did not work as expected. For instance, git was no longer found.
My third and final day at Øredev 2012 offered some really nice talks, as well as a really crappy one.
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.
Inspired by Øredev and all the great sessions, I finally installed Windows 8. I decided to upgrade my Windows 7 installation, and found the installation quick and painless….and the activation a nightmare.
I am happy to once again attend Øredev in Malmö, Sweden. Three days with great speakers and nice friends is just what is needed in the dark, Swedish November.
I have an app with a main menu, where users can swipe horizontally through a set of icons that take the user to certain parts of the app. When an icon is tapped, it bounces, plays a sound and takes the user to that particular part of the app. Let’s see how the bounce animation was made.
This post will show you how to localize your iOS apps, so they can be translated to several languages. I’ll will describe how to translate plain text and how to create localized versions of your storyboards.
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.
I am building an app that uses ARC (Automatic Reference Counting), which means I from now on will not have to handle memory management as actively as I have done before. There are still things you have to consider when using ARC, but it makes memory management a lot easier and less tedious.
I’m currently creating an iOS app that will share data using JSON. Working with JSON is trivial in iOS 5, since there’s now a great, native JSON serializer and deserializer.
I’m currently building an iOS app that uses core data for data persistency. It works great, but as I started retrieving entities by name, I noticed that they arrived in a strange order:
This is a short summary of the second day of the DevSum 2012 conference in Stockholm, Sweden.
This is a short summary of the first day of the DevSum 2012 conference in Stockholm, Sweden.
At the time of writing, this code-oriented blog was hosted on Wordpress. Since I post a lot of code, I wanted the blog to have nice syntax highlighting. This is how you do it on Wordpress.
I’m currently building an iOS app that will make use of the device camera. It works well, but since I’m also running this app on the simulator, I want to be able to select pictures from the photo library as well.
I am currently working with a new version of a hobby console application project of mine. The app will execute certain actions depending on the input arguments.
When building open-source, I used to handle the release process manually. Since each release involves executing unit tests, bundling, zipping and uploading to GitHub and NuGet, creating new git tags etc. the process was time consuming and error-prone. Since a release involved so many steps, I also released new versions quite seldom. Not good - automated build scrips to the rescue!
This is the final part of my Øredev 2011 summary. It covers the last three talks that I attended and concludes my visit to Øredev.
This is the fifth part of my sum-up of Øredev 2011. These sum-ups waere supposed to be rather short, but have grown out of proportions. I will try to keep it down.
This is the fourth part of my Øredev 2011 summary. It has taken quite a long time to get this finished, so I will write a bit less about each session and refer to external resources instead.
I’ve been using NDepend to analyze the latest version of my NExtra library. The code is overall good, but the code analysis highlights some interesting design flaws that I should fix in the next version.
This is the third part of my sum-up of Øredev 2011, which took place in Malmö, Sweden.
This is the second part of my sum-up of Øredev 2011, which took place in Malmö, Sweden.
Two weeks ago, I attended to the Øredev Developer Conference in Malmo, Sweden. I was there from Wednesday to Friday and it was truely inspiring. In this summary, I will write about sessions I attended, sessions I missed and a few sessions I heard a lot of good stuff about.
I could use some advice regarding a project that I’m currently working on, where people can sign up and join various groups (did I hear “Facebook is already doing that”?). I’m now torn on some implementation details and would love some discussions regarding where to put certain pieces of logic.
To grow as a developer, there’s nothing better than to invite others to criticize your potential flaws. This post will expose my shortcomings as a unit test loving developer. Enjoy!
After learning on how to automate and schedule NDepend to run for several .NET solutions at once and starting to use NDepend more regularly, the power of CQL has grown on me.
In a project of mine, I use NDepend to continuously run a scheduled code analysis on a bunch of solutions that make up a large part of the software infrastructure of a major Swedish company.
I currently have several GitHub repositories, where some also have a
branch with a public web site for each project. On these pages, I want to show
and link to the latest version.
When I recently decided to start re-creating a php project of mine from scratch,
I decided to replace
I am currently moving some projects from an old TeamCity 5.1.2 server to a brand new 6.5.1 server. Everything has been going great, until I tried moving a project that uses NServiceBus.
In ASP.NET MVC, Microsoft has done a nice job with creating various HTML helpers
that can be used in a form, e.g.
Let’s see how we can make our own.
When working with .NET, I sometimes find myself wanting to just clone a solution instead of setting everything up from scratch over and over again.
I have started to boot up Windows directly from my BootCamp partition on my iMac instead of running it under VMWare Fusion. This way, I don’t have to share resources with the OS X partition, which is nice for gaming, programming etc. There are however some rough edges.
Each time I open a WPF project in Visual Studio (2010) and open a XAML file, my computer switches from the semi-transparent theme to Windows 7 Basic.
Although I love OS X, I am still new to it and a Windows user by habit. As such, the unintuitive and secret clubesque keyboard shortcuts are not one of my most favorite parts with using OS X.
In a project of mine, NUnit suddenly started to warn that something’s wrong with the assembly. Turns out that accidentally disabling architectures is a bad thing.
A couple of days ago, I blogged about solving a frustrating problem that made my iMac dead slow. At the time of writing, I wasn’t sure if I had actually solved the problem. I can now say that I have.
I have been having big problems with my iMac 27″ (4GB RAM) that runs Windows 7 on a Boot Camp Partition (using VMWare Fusion). It is basically the same setup as I have on my MacBook Pro (which has 8GB RAM), with the minor difference that the MBP is fast as lightning and the iMac is slow as HELL!
This post will show you how to localize a WPF application that consists of a main application as well as several separate DLL projects that provides it with general user controls, model classes etc.
I have started building an ASP.NET MVC3 site that will use the Facebook API to create and authorize users. It’s really easy to setup, although running it on localhost requires some configuration.
I have started to use git in my .NET projects. It works really well, but I’m having problems with integrating it in Visual Studio. Turns out there’s a way to add a Git Bash window to Visual Studio.
My personal WPF WTF list has grown steadily since I started to work with WPF. In my opinion, WPF is filled with bad naming conventions and inconsistencies. Here are some examples.
ASP.NET validation attributes is a great way of making it easy to validate C# properties in different ways, client and server side. Let’s look at how we can create our own validation attributes.
In a WPF application that I’m currently working on, I have to hide the close button of a progress window to prevent users from closing it manually. Turns out that it’s complicated, but perfectly doable.
I have a hobby project that works great on MAMP, but that doesn’t run so good on WampServer, which seems to handle url rewriting differently. The fix turned out to be easier than expected.
I’m currently building a gps-based web application that lets mobile devices post their positions to the app, which then replies with nearby items of interest. To do this this, the backend has to be able to calculate the distance between two geo coordinates. Here’s how to to do this in C#.
The team behind Tiny MCE has created a great file upload component called
Plupload. It supports several runtimes – from jQuery-based uploads in HTML 4/5
to Flash, Silverlight, Gears etc.
I love HTML5, although it will take time for many browsers to support HTML5. Until they do, our code must be supported by older browsers as well. What if I told you that there’s a way to write HTML5 today, and automatically have it convert to HTML4 whenever needed?
Sometimes, Spotify stops being able to play music on iOS when it’s sent to the background. Whenever this happens, you may have to free up memory by removing some background apps.
I recently created a project template that uses the Spark view engine instead of the default Web Forms view engine. However, it didn’t show up in the project template list. Time for a template cache flush.
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 Spark a try first.
I am looking to use Umbraco ImageGen in a project that I’m currently working on. People who have used it really seem to like it, so I look forward to try it out. However, I did run into a cache problem.
I have spent some time experimenting with the new HTML 5
ViewState is ASP.NET’s way of simulating state in the otherwise state-less web
environment. It’s a cool technology, that is however easy to misuse.
About a year ago, I had problems when sending data to a php page, using AJAX. To
be able to unpack the data, I had to use
stripslashes. Since it seemed to work,
I was happy…until the world exploded.
As some of my hobby projects are coming together, I have meant to move them from Google Code to GitHub for quite some time. Tonight, I decided to give it a try and say hello to git and GitHub.
NuPack is a free, open source, developer-focused package manager for .NET. It looks absolutely awesome, so I downloaded it and gave it a try. Let’s have a look at how to use it.
I love the jqGrid jQuery plugin. If you haven’t
tried it, I think you should. However, the
onSelectRow event doesn’t work that
well. Let’s fix it.
After some time, 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!
Yesterday, I built a simple demo page to demonstrate how easy it is to get fonts.com Web Fonts up and running. However, as I did, I noticed that Internet Explorer disables custom fonts during animations.
The time has finally come to throw Arial and Verdana into the trash (Helvetica can stay for a while), as Monotype, Linotype and ITC (and others) have teamed up to develop a really cool service - web fonts!
I’ve been trying to find out how to get the name of the current controller and action in ASP.NET MVC. If you’re curious on how to do it, do read on.
Since I’m just pretending to be a PHP developer, I only just now started to use PHP 5.3.2. The reason for this is that I just installed Aptana Studio 2, which comes with PHP 5.3.2 installed.
Today, my collegue Johan showed me a css fix for a problem that happens when a div container has nested, floating divs.
This post describes how to solve the problem that model validation will not work for ASP.NET MVC 2 when testing a model that uses DataAnnotations and MetadataType to describe for its validation.
I am working with model validation in .NET, Entity Framework 4,
partial classes with
MetadataType connections and now have a problem where exceptions
are thrown when posting empty data for non-nullable properties.
I use both MooTools and jQuery in various projects. As I now have started moving more towards jQuery, I only use MooTools for its nice type and json capabilities. Let’s look at how to implement this in jQuery.
I am currently implementing css file bundling with virtual paths in php and am facing a problem, where slashes in the url query make file imports fail.
I’m currently working on a css bundler, where aim to bundle files from different folders into a single file. This post describes how I had to replace content bundling with import bundling.
I have a license for R# at work. It’s a really nice utility that saves me a lot of time. Besides providing a lot of shortcuts and extensions to Visual Studio, it also integrates NUnit in a convenient way.
I’m currently playing around with a board game engine in XNA, where players can play missions that take place on a tile-based board. I’m now working on using the A* algorithm to find paths between tiles.
I’m currently developing an adventure board game in XNA, where players can play missions that take place on a board that is made up of square tiles. It’s a lot like the amazing, old board game Hero Quest. In this post, I’ll describe how my custom-made game engine generates a board from a bitmap.
I have recently been playing around with the XNA game framework that can be used to develop games for the Xbox 360. It’s fun, but different from the code I usually write. For instance, I’m currently trying to implement the A* pathfinding algorithm in C# for a board game that I’m working on.
After a couple of evenings, my first (really simple) iPhone app is taking shape. However, I’m currently struggling with reusing functionality across apps.
As I’ve started to look into iOS development, I have created a test app with a tab view and four views (the $$$s are not far away). I now want to store data without a database. Can this be done?
I recently picked up my old, black Xbox from the basement, where it has lived in solitude since I bought my Nintendo Wii. Since it is old and much has happened with the video game indistry since it came out, I don’t game on my XBOX anymore. Let’s look at some media server fun you can have with it instead.
I have some strange updates regarding the greeen/orange blinking MagSafe I wrote about yesterday, where the LED on the MagSafe toggles green/orange, even when the battery is fully loaded.
In my last entry, I wrote about the many problems that I’ve had with my MacBook. In this post, let’s have a look at the green/orange MagSafe disco light.
I have previously written about my numerous problems with my new, white MacBook, which I purchased in August 2007. As icing on the case the battery has now swollen.
I have started looking at XNA and am currently working with assets in a small game. This post show how to load all assets in a folder, which is convenient for smaller games where resources isn’t as critical.
I’m using Doxygen to generate a web-based documentation for various .NET projects. This short post will show you how to configure Doxygen to achieve this.
This post will show you how to easily show all hidden files in Finder, both with a Terminal script and a keyboard shortcut.
Edit Aug. 28, 2010
SleepWatcher has been changed since I wrote this post
and now differs from the information found in the link below. This approach does
still work, though, as does the modified script.
This post looks at how to easily paginate collections in C#, which can be easily achieved with two very basic extensions.
I’ve been trying to use special characters (like « and ») to model
errors that I add to
ModelState. This post shows you how to do it.
From time to time, I forget where various classes in the .NET framework are defined. For my future self and those of you who also struggle, here’s a short tutorial on how to get JSON working in C#.
As I continue to work with unit tests, I have noticed that some of my development patterns have started to change…for the better.
I have finally started creating my first web site with ASP.NET MVC. After looking through the nice start examples, I noticed that .css files were manually included in the master page. Let’s have a look at how to use ASP.NET themes instead.
In a typed language, it can be handy to retrieve all types that inherit a certain base class. Let’s have a look at how to do this.
This post was written in 2009. Although the core logic hasn’t changed since then, the implementation has. For the lastest implementation, check out NExtra on GitHub.
When developing .NET applications, XML comments is a good way of documenting the code. These comments can then be used to generate HTML documentation. Let’s have a look at how to do this.
I’ve had a lot of problems with getting URL rewriting to work with Windows Vista and IIS 7. Compared to IIS 6, virtual paths in IIS 7 don’t allow extensions like .js, .css, which is problematic if you have shared files in virtual paths.
I am currently having problems with the Single MP3 Player with the jQuery Flash plugin, which fails to download files in other folders.
I currently have problems with identifying the project root in a PHP project. The problem applies to PHP, but the discussion is general and applies to the other languages and environments as well.
After an interesting conference talk on Test and Behavior Driven Development (TDD & BDD), I have now started using NUnit to write unit tests in C#. Here are some initial thoughts from a TDD n00b.
I have had some serious problems with UTF8 and PHP’s built-in JSON functionality. After solving it, I realized that it was not even an UTF-8 issue, but a JSON one.
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.
This post will show you how to automatically convert media links with jQuery, for instance audio links to a Flash-based audio player.
In this post, we’ll look at how the
SelectionChanged event can
behave strange and how to fix it if it does.
After clean installing Windows Vista, Visual Studio 2005 and Visual Studio 2008 on my work computer, I started having problems with using dynamic ports with ASP.NET.
After upgrading to Windows Vista, I’ve had many problems with running Visual Studio 2008 and IIS 7 on it. This blog post discusses some problems and how to solve them.
On my spare time, I develop a PHP web application on OS X and thus test my sites in Firefox, Safari and Opera on a daily basis. More seldom, I also verify that it works in Internet Explorer. Or doesn’t.
In this post, we’ll discuss how empty image src values can ruin the performance of your web site, and how you can to solve it.