Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
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
Coding outside in nature is goated. Can't wait for summer... ☀️
Yesterday was my first time cooking outdoors this year. As usual for me, the menu is burgers 🍔😂 image
I'm constantly running into performance bottlenecks with SwiftUI... Trying to build a minimap in my notes app similar to what Sketch has in their app, but it's clear that I either need to make the minimap more simple or drop down to low level APIs. I think Sketch does text rendering via `CoreText` and uses `Metal` (aka `Core Graphics`) to paint pixels directly on the screen. They might only use one `NSView` for the canvas itself. This is very different from how I do this, as I'm rendering each object as a separate SwiftUI view. **The minimap in Sketch app:** image
It's fascinating to think about how writing code by hand is mostly now a thing of the past. At least in app and web development, LLMs are so good that I barely write any code myself. Instead I spend my time writing detailed spec sheets with descriptions of the task that the AI should complete. Besides that I do a huge amount of code review. Of course, sometimes I hit a roadblock with LLMs where they hallucinate. E.g. making up methods that don't exist in a 3rd party API. But that's easy to fix - just copy the method definition so the AI can see the correct method name, parameters, return type, and so on...
Done ✅ Tomorrows task is going to be implementing a fix for an issue I discovered just now: If I open two tabs with a canvas file in each tab, I am unable to perform magnification in either of the canvases. In other words, I cannot zoom in and out. The app is not frozen or anything like that. I can switch tabs, open new files, etc. but inside the canvas files, I just can’t perform the pinch gesture - nothing happens. #dev View quoted note →
I fixed my "oopsie", so now I can continue implementing features. View quoted note → Will implement a feature to convert a "- " to list item in the JSON notes. Will also fix a bug where converting a list item to text block will unfocus the block. The expected behavior is that the cursor should stay in the block, so the user can continue editing after having clicked enter/return key on an empty list item block - this converts the list item to a normal text block.
Damn I hate Xcode... I got the popup with two buttons: "Keep Xcode Version" and "Use Version on Disk". I clicked "Use Version on Disk", and I regret that choice very much now... It deleted all my uncommitted changes 😂 You would expect the version control to allow you to go back again, but nope, not possible.
When I zoom in very far I experience lag spikes in the visual canvas. That's obviously not optimal... Need to find a fix. I think it might be because I apply a `.scaleEffect()` to all objects in the canvas. Maybe by scaling the entire parent container via a single `.scaleEffect()` will solve it. This should keep the objects drawn at their native 1x sizes and x, y positions. Hopefully that will solve the lag spikes. #dev
Added a minimap to the infinite canvas! 🚀 image **The inspiration:** When I first started using the Sketch app to design user interfaces, one of the features I liked most, was their minimap. I find it really helpful to navigate around. I wanted my notes app to have a similar minimap feature. **Functionality:** The picture shows the first version of the minimap in my app. You can click anywhere in the minimap and it will then move the viewport to that position on the canvas. The box can also be dragged around to move the viewport. The box in the minimap shows what the user is currently seeing. This means, as the user is panning around the canvas, the box will also move. If the user zooms in or out, the box will increase or decrease in size. **Future development:** I am quite happy with the functionality of it. I don't see what more should be added, so I will work on improving the UI. #dev #Swift #SwiftUI #AppKit #macOS
I got link previews working 🚀 image Simply copy a link and paste it into a canvas file. This will then convert the link to a link preview object with an image, title, and the URL. It's also possible to paste a link into an empty text object, which will then convert it to a link preview as well. #dev #Swift #SwiftUI #AppKit #macOS
Now that I got video objects to work nicely in the visual canvas of my notes app, I will work on drag and drop functionality tomorrow. For example, I will make it possible to drag and drop image and video files from the ‘Files’ sidebar and into the visual canvas. Furthermore, it should also be possible to drag and drop an image or video file from outside the app (e.g. Finder) and into the visual canvas. And lastly, it should be possible to copy-paste an image and video file into the visual canvas. That’s the mission for tomorrow… #dev
I finished sewing the neckband to the t-shirt that I have been working on. I had to undo the seam because I didn’t stretch the elastic neckband fabric enough… But now on second try, it looks quite good. It’s the second sewing project I have ever done. There is definitely room for improvement. The fit of the t-shirt is perfect. Perhaps the shoulder seam should have been just a bit longer, but I’m very happy with it. In terms of what could have been better, it mostly has to do with the actual sewing. I especially need to work on my patience to take it slow. I’m used to software engineering where I can just quickly delete and start over if I made a mistake. It’s not that simple when it comes to sewing. Undoing a seam takes time and it causes damage to the fabric like small holes from the needle. #sewing image
I enabled Developer Mode on my iPhone and I just sideloaded Stremio IPA file. I didn’t even know that was possible on iOS. It was big reason why I purchased an Android phone some years back, but was never satisfied with the apps. Idk why, but apps on Android just lack so much of the nice UX from iOS in my experience…
The visual canvas is improving a little bit each day. Text and image objects are mostly finished now. Tomorrow I will work on getting videos to work. I need to decide if I want videos to autoplay. It might become problematic in terms of performance if there are like 10 videos in the visible area. Obviously, videos that are not in the visible area should not play… Another option is to only play a video if the user is hovering over. Tbh I think it should just be a setting that users can toggle. #dev image