WithPopover

In this last post I‘ve proposed an OutlinePicker for SwiftUI. But, to be honest, I am not quite satisfied with this solution. The selection view appears as a sheet in contrast to the standard picker and its layout deserves some more fine tuning.

The problem with the standard popover modifier in SwiftUI is that it’s mutated to a sheet presentation on iPhones. I know, there is this new modifier presentationCompactAdaptation(horizontal:vertical:) but that’s only available since iOS16.4. In addition, I want to use a List in the popover and that’s collapsed to a tiny square if you do not specify a frame size. To make a long explanation short: I prefer to use the nice utility view „WithPopover“ for the presentation of my picker selection.

Weiterlesen

An Outline Picker for SwiftUI

If you want to display an outline in SwiftUI you may use the framework supplied OutlineGroup construct. That’s based on a nested tree of DisclosureGroup and is quite nice. But on appearance of the OutlineGroup all outlines are collapsed. Well, in one of my projects I wanted to display the outline all expanded on show up. No way to do that with OutlineGroup as far as I know. But then I found this nice variant (https://stackoverflow.com/questions/62832809/list-or-outlinegroup-expanded-by-default-in-swiftui) with a control of expansion:

Weiterlesen

Text Fields in Lists on macOS SwiftUI

Today’s post is a bug report. I’ve sent a developer feed back to Apple already but got no response yet. I don’t know exactly when Apple introduced this bug. But it may well be with the first release of macOS Ventura (13.0) and it’s still not fixed as of macOS 13.4.1.

At that time I’ve noticed that the text fields of one of my macOS Apps got an unintended left padding when included in a List. Here is a very simple test code to demonstrate the problem:

Weiterlesen

Missing Tiles in MKTileOverlayRenderer

Well, there is a bug in Apple’s MapKit since iOS 13.2, as the folks in developer community say: If you want to use non-Apple maps (e.g. OpenStreetMap®) occasionally tiles are not rendered although you supply the correct data in your sub-class of MKTileOverlayRenderer. There seems to be no obvious systematic but if you scroll around the map you’ll soon find missing tiles. There seems to be no real fix for that problem and your app will not be notified if that happens; the delegate method mapViewDidFinishRenderingMap(mapView:fullyRendered:) will always signal „fullyRendered“ although tiles may be missing. Weiterlesen