MapKit: Change in Behaviour of addOverlay on iOS 16 / Xcode 14.0

Just after I have published my latest app project „Muvy“, a very nice tracking app for all outdoor activities, Apple released iOS 16 and Xcode 14.0. With big horror I had to notice that my app was not working properly with the new version of the operating system. All non-Apple maps were covering my tracks so that they were not visible anymore. What a pity. It turns out that Apple changed the behaviour of the quite central method addOverlay without notice.

Weiterlesen

Open the last used document on App startup

Did you ever want your app to open the last used document on startup? Well, that’s not too difficult on macOS. In your NSDocumentController subclass you have the array of recentDocumentURLs, and on startup you can try to open the first member if it exists.

But on iOS it’s a little bit more tricky. There is no such array as on macOS. So we have to mimic it by ourself.

This is a review of my post 2 years ago: UIDocumentBrowserViewController and External Storage

Weiterlesen

Aliases in Synology WebStation on DSM 7

Recently, I have updated my Synology NAS to DSM 7. I was positively surprised that most of the apps I use work without problems. The new Synology Photos app is not that nice compared to the old Photo Station 6 but anyway, it will improve, I hope.

There is a bigger update on the WebStation under DSM 7. Formerly, it was quite difficult to run a website (let’s say: a WordPress instance) under the main domain name of your installation (e.g. as fpposchmann.de). The standard installation would access a WordPress instance under fpposchmann.de/wordpress; quite ugly. The Apache aliases could not be configured in the WebStation. I found no way to change that by standard configuration means and ended up configuring my own apache.conf.

Weiterlesen

Creating a macOS document based app with SwiftUI and the new App protocol

Have you already tried to create a macOS document based app with SwiftUI and the new App protocol? Well, there are some problems to solve esp. if you want to use menus focused on the currently open document.

In the old app cycle with AppDelegate / SceneDelegate you still had to use the storyboard to define the menu items and link them to your methods in your document class derived from NSDocument. Enabling and disabling of the menu item according to the open documents was automatically managed by the frameworks.

That’s not the case in the new App protocol of SwiftUI anymore. Instead, you can define your menus and menu items quite nicely in your App struct conforming to the new App protocol but there is no automatic link to the current document in focus.

Weiterlesen

SwiftUI Previews: 5s Update Error

Currently, I am developing a quite complex Mac application using Core Data together with SwiftUI. The first challenge I encountered was the SwiftUI preview. I implemented a special preview model with some test data that is assigned to the preview structs of my views as EnvironmentObject. That works fine and I enriched my application step by step.

Well, but suddenly the previews stopped to work. I always got the error message „Updating took more than 5 seconds.“ I suspected one of the recent changes to screw up my work although the completely built applications still worked fine. I walked through my code and certainly found some problematic points but nothing could make the preview show up again.

Weiterlesen