Skip to content

Fix: implement NSView layout-guide support - #552

Merged
fredkiefer merged 2 commits into
gnustep:masterfrom
DTW-Thalion:fix/nsview-layout-guides
Aug 16, 2026
Merged

Fix: implement NSView layout-guide support#552
fredkiefer merged 2 commits into
gnustep:masterfrom
DTW-Thalion:fix/nsview-layout-guides

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

The NSView (NSLayoutGuideSupport) category (addLayoutGuide:, removeLayoutGuide:, layoutGuides) was declared in NSLayoutGuide.h but never implemented, so a view could not host layout guides.

This tracks the guides on the view, sets each guide's owning view on add and clears it on remove, ignores duplicate adds, and returns an empty array (not nil) when there are none.

Verified against AppKit on macOS: after addLayoutGuide: the guide's owningView is the view and layoutGuides contains it; after removeLayoutGuide: both are reversed. Includes a test. Existing NSView tests still pass.

@DTW-Thalion
DTW-Thalion requested a review from fredkiefer as a code owner July 16, 2026 00:47
The NSView (NSLayoutGuideSupport) category was declared but had no
implementation, so -addLayoutGuide:, -removeLayoutGuide: and
-layoutGuides were unavailable.  Track the guides on the view, set and
clear each guide's owning view, and report them.
@DTW-Thalion
DTW-Thalion force-pushed the fix/nsview-layout-guides branch from deda9ce to 3dddf83 Compare July 26, 2026 11:08
START_SET creates an autorelease pool and END_SET releases it, so the pool
these tests create around the set is redundant.
@fredkiefer
fredkiefer merged commit 50fa356 into gnustep:master Aug 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants