vknabel
vknabel
Valentin Knabel
Developer, cyclist, coffee nerd, human. Open Source, kindness, honesty, vegan. It is fine to be imperfect, as long as we are honest and have fun along the way.
Latest Posts
Iterating over a map in Go is not predictable. This is a design decision to avoid relying on memory layout. for k, v := range map { // always prints different results! fmt.Printf("%s: %s\n", k, v) }
I had completely forgotten about NSDataAsset. Maybe I should move some of my JSON files into asset catalogs. According to @emergetools that should remove some code signing overhead from the app size. Tweet by @simonbs
When using auto layout with a UIScrollView, subviews may not attach to the top edge of the scroll view’s parent. Else you cannot scroll, but the handle shrinks the more you scroll. Setting left and right is ok to fix the width if you do...
Starting with Swift 5.6 the Swift Package Manager can automatically detect Breaking API changes. Really great for libs! https://twitter.com/fabianfett/status/1504393754412822530?s=12
Async tests do not work on Linux, only on macOS. Instead you need to implement a helper function that runs the test async by relying on expectations. https://www.swiftbysundell.com/articles/unit-testing-code-that-uses-async-await/
Cookies in WKWebView are broken. When manually setting a Cookie using the Configuration, it will be ignored by the web view. Workaround: add a UserScript with the following code: document.cookies = 'cookie_optin=essential:1|analytics:0'...
Sometimes you need your local IP address on the command line to automatically pass it to a script. ifconfig en0 |awk '/inet / {print $2; }'
If the default Table Of Contents / Index Set for iOS does not fit your use cases. This library might be interesting: https://iosexample.com/table-of-contents-selector-built-with-swift/
Back in 2019 I wrote an article about how to debug your Swift Package Manager projects in Visual Studio Code. In late december 2021, the Swift Server Working group released a brand new extension for vscode, which dramatically improves...
In case your UINavigationBar has been set to a custom color and the navigation bar is not translucent, you will experience a visual regression when updating to Xcode 13. The navigation bar background will be black - until you start...
Today I learned about asdf, which is a pluggable version manager. Previously I used nvm, rvm, swiftenv and more. I now use asdf. Just add the plugin of your choice and install your desired versions. The only drawback is installing...
Copying contents from the web often copies weird characters, like the invisible character U+FEFF or “Zero Width No-Break Space”. Code editors like VS Code might highlight those characters depending on your config, but other websites...
I tried to keep my work stuff separate from my personal stuff on the same machine. I created two admin users, set up a group for homebrew and set the permissions accordingly. Sadly this didn’t work out in the long run. So I started to...
A few months ago Swift 5.5 has been released and made async/await available. And in 4.50.0 Vapor added support for it, too! If you are still on Vapor 3, you first need to upgrade your server to Vapor 4. Now we can migrate most usages of...
Converting a simple and small iOS app was far easier than expected. Of course webviews, gesture recognizers, navbars, etc. are not supported or work differently, but at a first glance there are not a lot parts with visual regressions!