Post

Replies

Boosts

Views

Activity

How to hide LayoutView from a Layout?
I have implemented a custom Layout, specifically a label view that hides any trailing views that are clipped. Now in my placeSubviews() method - even if I don't explicitly place a view - SwiftUI will layout the view and show it. As there seems to be no way to hide a LayoutSubview, I have resorted to placing the view somewhere very far off screen like this let maxOffset = CGFloat.greatestFiniteMagnitude let offScreen = CGPoint(x: maxOffset, y: maxOffset) subview.place(at: offScreen, proposal: .unspecified) but I don't really like this solution. Is there an official Apple "sanctioned" way how to hide LayoutSubviews inside a Layout?
2
3
960
Aug ’23
No proper replacement for LaunchServices functions
Apple deprecated launch service calls like LSCopyAllRoleHandlersForContentType, referring to -[NSWorkspace URLsForApplicationsToOpenContentType:] instead. However all those new NSWorkspace methods do not have the crucial LSRolesMask the launch service calls have. For example, I have code that looks up all alternative shells, and with LSCopyAllRoleHandlersForContentType I could simply provide LSRoleMask.shell to restrict the returned bundle identifiers to shells only. This is not the first time Apple deprecates stuff without a proper replacement and I don't really get it. Every OS update is basically a downgrade. Or is there another way to replicate the old launch service call behavior?
2
1
912
Nov ’23
TextKit2 textContentManager(_:shouldEnumerate:options:) leaves gaps in layout
Returning false from NSTextContentManagerDelegate.textContentManager(_:shouldEnumerate:options:) produces huge gaps in my layout instead of showing a continuous block of text. Instead of omiting the layout of the hidden element, there is a blank space that shows that appears to have the same size in layout as the omitted text element. Why is this happening and how can I prevent this? Example:
1
0
732
Aug ’24
Xcode 26 RC doesn't properly use build configurations
We have several build configurations in our project, yet Xcode seems to ignore them when changing the run configuration in the scheme. There are several OTHER_SWIFT_FLAGS set like this but all code paths using conditionals like #if APPSTORE_BUILD etc. that worked previously with Xcode 16 just all default to the Debug (RETAIL_BUILD) configuration now.
1
0
162
Sep ’25
What happened to CMD-Option-Click?
What happened to CMD-Option-Click in Xcode 26 for opening a symbol in a new editor split pane? This was one of the most usefull shortcuts. Xcode 26 is a pain to use without it.
Replies
6
Boosts
0
Views
198
Activity
Sep ’25
How to hide LayoutView from a Layout?
I have implemented a custom Layout, specifically a label view that hides any trailing views that are clipped. Now in my placeSubviews() method - even if I don't explicitly place a view - SwiftUI will layout the view and show it. As there seems to be no way to hide a LayoutSubview, I have resorted to placing the view somewhere very far off screen like this let maxOffset = CGFloat.greatestFiniteMagnitude let offScreen = CGPoint(x: maxOffset, y: maxOffset) subview.place(at: offScreen, proposal: .unspecified) but I don't really like this solution. Is there an official Apple "sanctioned" way how to hide LayoutSubviews inside a Layout?
Replies
2
Boosts
3
Views
960
Activity
Aug ’23
No proper replacement for LaunchServices functions
Apple deprecated launch service calls like LSCopyAllRoleHandlersForContentType, referring to -[NSWorkspace URLsForApplicationsToOpenContentType:] instead. However all those new NSWorkspace methods do not have the crucial LSRolesMask the launch service calls have. For example, I have code that looks up all alternative shells, and with LSCopyAllRoleHandlersForContentType I could simply provide LSRoleMask.shell to restrict the returned bundle identifiers to shells only. This is not the first time Apple deprecates stuff without a proper replacement and I don't really get it. Every OS update is basically a downgrade. Or is there another way to replicate the old launch service call behavior?
Replies
2
Boosts
1
Views
912
Activity
Nov ’23
TextKit2 textContentManager(_:shouldEnumerate:options:) leaves gaps in layout
Returning false from NSTextContentManagerDelegate.textContentManager(_:shouldEnumerate:options:) produces huge gaps in my layout instead of showing a continuous block of text. Instead of omiting the layout of the hidden element, there is a blank space that shows that appears to have the same size in layout as the omitted text element. Why is this happening and how can I prevent this? Example:
Replies
1
Boosts
0
Views
732
Activity
Aug ’24
AppKit equivalent for ControlSize.extraLarge
Since macOS 14 there is a ControlSize.extraLarge in SwiftUI, however there is no corresponding AppKit NSControl.ControlSize.extraLarge, which seems weird. Surely this is an oversight?
Replies
1
Boosts
0
Views
723
Activity
Oct ’23
Xcode 26 RC doesn't properly use build configurations
We have several build configurations in our project, yet Xcode seems to ignore them when changing the run configuration in the scheme. There are several OTHER_SWIFT_FLAGS set like this but all code paths using conditionals like #if APPSTORE_BUILD etc. that worked previously with Xcode 16 just all default to the Debug (RETAIL_BUILD) configuration now.
Replies
1
Boosts
0
Views
162
Activity
Sep ’25
Proper way to detect TestFlight builds in iOS 18
I used to detect TestFlight builds prior to iOS 18 by the bundleReceiptURL like this. The deprecation message points to AppTransaction instead of using receipts directly, but that does not help with my use case here. What is the proper way to detect a TestFlight build now?
Replies
0
Boosts
1
Views
95
Activity
Jul ’25