Avatar
Frederik Handberg
9c9f81ed795f0f5efa558932824687d84fc7e6a4cfa6db5d6d3b50fcb7ffaec2
23 šŸ‡©šŸ‡° Studying for a degree in Software Engineering while building fun projects and working freelance as a News Photographer šŸ“· I share my software projects, photos and videos from my work as a news photographer, and progress updates as I learn to sew garments. Basically, I just write about my hobbies. frederikhandberg.com

Semi-truck crashed on E45 Horsens #press

I’m hooked on the Canon C50… Looks like a great hybrid camera like the Sony FX3.

I think the C50 and FX3 would be great together (even though their color profile is quite different, but that doesn’t matter for the work I do).

One camera with a 35-150mm lens and the other with a 200-600mm.

Now, the shitty thing is that I have two lenses for Sony; the Tamron 35-150mm and Sony 200-600mm. Both are incredible lenses.

But with Canon, I’d need an RF lens, and I don’t like any of them... The Canon 200-800mm is not bad, but it does not have internal zoom like the Sony does.

The reason for me wanting a second camera is so that I don’t have to change lenses all the time. It sucks missing a good shot because you’re messing around with the lenses. Not to mention, the risk of me dropping a lens is quite high when everything around me is so chaotic (like at the big structure fire I was at yesterday).

Major fire at a summer house in 7130 Juelsminde #press

I just finished implementing code blocks in my notes app šŸš€ #dev #macOS #Swift #AppKit

Thanks for sharing. It looks interesting, but Windows and Linux is not supported as far as I can see…

Also, I really don’t like Rust. It just doesn’t look very nice 😬

I’m currently building a notes app for macOS and I’m starting to get a pretty good grasp on AppKit, and UIKit is similar, so should be fairly easy.

I expect Jetpack Compose to also be easy from the example code I’ve seen. It also looks really nice, so I’m excited to learn that. Kotlin is basically Java which I already know well.

I feel like there’s always shortcomings with the crossplatform frameworks, unfortunately…

I finished drafting my t-shirt pattern in CLO3D and got it printed.

Now I need to trace it onto real pattern paper. #sewing

For the past month or two, I've been working on some pretty complex logic to support caret navigation and text selections across multiple sequential `NSTextView`s in #AppKit.

I need this functionality for my block-based notes app, where each block lives inside its own text view.

The problem is that by default #macOS doesn't natively support caret navigation or text selection across multiple text views. This would be a big problem for the user experience in my app, so I had to build a solution!

My solution lets the user move the caret smoothly between text views just by using the arrow keys. On top of that, the implementation also supports making text selections across text views.

The user can even copy text from a selection that spans multiple text views.

In the video, the red borders show the boundaries of each text view. Notice how I'm able to move between them seamlessly, as if it were one continuous editor. #dev

https://video.nostr.build/c887a852d12445f9e61e42d0d87924461ef2d35c1c3040acf20a83d66b0ce506.mp4

From a learning perspective, I definitely think I’m making the right choice by building natively for each platform, because it lets me experience many different ways of doing things. Every language and framework has its own patterns and philosophies. Because of that, I’m getting a lot of practical experience that in the future, will help me make better implementation decisions.

At some point, I’ll need to learn Electron and React Native. It should be easy, considering it’s React, which I’ve already used a lot.

Tauri would be cool too, mostly because it’s much less bloated than Electron. But it sure isn't Rust that’s drawing me in… #dev

nostr:nevent1qvzqqqqqqypzp8yls8khjhc0tma9tzfjsfrg0kz0cln2fnaxmdwk6w6sljmlltkzqyt8wumn8ghj7un9d3shjtnwdaehgu3wvfskueqpz3mhxue69uhhyetvv9ujuerpd46hxtnfduqzpm9tydg9l0txepmprszzgggjx3e03qq7emgwrv2tfh5ngd50g29lwhhqkz

It’s difficult not to want to just scrap #AppKit and go all-in on #Electron or #Tauri.

If my app was a macOS-exclusive, going the native route would be no problem - but this is not the case… I do want my notes app to be available on all the major platforms (iOS, Android, macOS, Windows, Linux, and the web).

Building a native app for each platform is a massive undertaking - even for a large team of developers, let alone a single person. In fact, I would argue it’s naive to believe one person can realistically achieve this (even with LLMs). Sure, it's *possible*, but keep in mind, that you’ll be spending an enormous amount of time pushing every feature to every platform, while your competition using Electron and React Native move much faster.

This becomes a big problem from a business perspective. Customers expect you to keep up with the competition, but that is nearly impossible when you're maintaining five separate codebases instead of just two (Electron and React Native where much of the code can be shared).

If this project was purely for the sake of business, I probably made the wrong choice by going native šŸ˜… But hey, I'm new to programming, so I think it's good that I'm making all these choices and learning from them. This project is about learning the craft of programming. Of course, I'd love for this project to eventually make a living income - that'd be a dream come true.

I started my Software Engineering degree ā‰ˆ2,5 years ago. I had coded before that, but just some pretty basic Remix and Next.js. I would barely even call that real programming considering how little logic was involved (mostly just mutating state values) to what I'm doing now with AppKit where I'm working with low-level APIs that are poorly documented. #dev

Besides caret navigation, the functionality also includes making text selections across multiple sequential `NSTextView`s.

When this is fully implemented in the final project, I think I should try to get `NSTextView` working with `NSTextAttachment`. I do actually have that working, but I chose to abandon this approach temporarily because merging all the blocks into a single `NSTextView` caused problems with incorrect ranges.

Obviously, the problem is because of the logic that is either missing or incorrect somewhere in my code.

But I’m glad I now have the approach with separate text views mostly working.

I’ve been quiet on Nostr. Just been hustling to implement custom solutions to fix the problems I ran into with my notes app - more specifically `NSTextView`.

The worst part is, I only have a functional solution for #AppKit (which is for #macOS). When I start developing the #iOS app, I will need to implement the same functionality but this time in #UIKit.

I have no idea if UIKit even gives me the control I need for `UITextView` to achieve the same functionality I have with `NSTextView`. The thing is, I’ve never used UIKit before, but I also had no experience with AppKit before starting this project and so far it’s going fine…

The functionality I’ve been implementing is to allow navigating the caret across multiple sequential `NSTextView`s.

This is essential for my notes app and I finally have a working solution.

Only basic stuff is missing like `Cmd+A`, which should select text in all the text views (currently only selects text in the focused text view). I do already have this functionality, but it’s in a different Xcode project, so I’ll need to integrate it into the new one. #dev

But anyone can broadcast anything to relays?

If the idea is to have relays kinda like subreddits, then I assume that would require the relay operator to look through all notes on their relay and delete unwanted.

Cooking outside is nice. It’s just a shame it gets dark so early now, so I can’t look over the landscape… #food #burgers

I guess we are from two very different countries, because where I live, knowing how to code does not get you a job unless you are talented or have a degree. There’s a ton of competition between average programmers in my country.

Also, it must suck not enjoying any of the things you work on šŸ˜…

You clearly don’t enjoy it. Building stuff and solving bugs are part of the fun for me.

If you don’t find that fun and interesting, then why are you even trying to learn coding?

Purchased an outdoor gas stove for camping.

Let’s cook some bacon šŸ„“

It’s hard to get rid of Reddit. It’s such a good place to find help and especially for coding related questions.

I basically always write ā€œredditā€ at the end of a Google search.

We need communities like subreddits on Nostr. Pretty sure I’ve heard about it already being worked on

Building a simple todo list app for fun.

Taking a break from the notes app. The #Markdown rendering is difficult, as I can’t just render HTML. I mean, technically I could. Nothing is preventing me from using a `WKWebView`, but I don’t want that. I want the app to be completely native, and embedding a small website in the app isn’t really native…

Now I’m developing a little todo app. Need to add dates for deadlines, implement searching, functionality to edit and delete - I think that should be it.

Perhaps make a menu bar app for it as well. It’s really just a project I’m doing for fun to improve my Swift skills. The notes app was the first real Swift app I’ve ever worked on, and it’s super hardcore to build (mostly because of Markdown rendering), so not exactly an ideal first project. This todo app is much simpler. #dev #Swift #macOS

I had underestimated how much SVG code it takes for a QR code.

It was simply not practical to inject the SVG code directly into the `