Skip to content

Make TOCropOverlayView.h public so the grid overlay is visible to Swift - #653

Merged
TimOliver merged 1 commit into
mainfrom
fix/public-overlay-header
Jul 28, 2026
Merged

Make TOCropOverlayView.h public so the grid overlay is visible to Swift#653
TimOliver merged 1 commit into
mainfrom
fix/public-overlay-header

Conversation

@TimOliver

Copy link
Copy Markdown
Owner

TOCropView.h declares gridOverlayView as a TOCropOverlayView *, but only forward-declares that class. Swift omits any property whose class it knows solely as a forward declaration, so cropView.gridOverlayView did not exist from Swift in any configuration — framework, CocoaPods, or bridging header. That also put the displayHorizontalGridLines / displayVerticalGridLines settings fixed in 3.2.0 out of reach for Swift callers.

Why it needed the header to go public

Importing the header from TOCropView.h is the fix, but it only works if the header is reachable under the framework's own module. TOCropOverlayView.h was marked Project in both framework targets, so <TOCropViewController/TOCropOverlayView.h> didn't resolve and the Xcode 26 module verifier failed on the quoted fallback.

It's now Public in both targets — alongside the other headers TOCropView.h already depends on — and imported using the same conditional form already used for TOCropViewConstants.h.

Regression guard

The test bundle's bridging header had been importing TOCropOverlayView.h directly to work around this. That workaround is removed, so the existing Swift test is now the guard: reverting the import in TOCropView.h makes CropViewControllerTests.swift fail to compile with

value of type 'TOCropView' has no member 'gridOverlayView'

Verification

  • Xcode 26 module verifier passes; the built framework now ships TOCropOverlayView.h alongside the other five public headers
  • 33 tests pass; all five schemes build
  • SPM builds for iOS; both podspecs pass pod lib lint
  • clang-format clean

The changelog entry is filed under 3.2.0, since that hasn't been tagged or pushed to trunk yet. Happy to move it to its own section if you'd rather ship 3.2.0 as-is.

TOCropView.h declared `gridOverlayView` as a `TOCropOverlayView *` but only
forward-declared that class. Swift omits any property whose class it knows
solely as a forward declaration, so `cropView.gridOverlayView` did not exist
from Swift in any configuration -- framework, CocoaPods or bridging header.
That also put the `displayHorizontalGridLines` / `displayVerticalGridLines`
settings fixed in 3.2.0 out of reach for Swift callers.

Importing the header from TOCropView.h is the fix, but it only works if the
header is reachable under the framework's own module: TOCropOverlayView.h was
marked Project in both framework targets, so `<TOCropViewController/
TOCropOverlayView.h>` did not resolve and the Xcode 26 module verifier failed
on the quoted fallback. It is now Public in both targets, alongside the other
headers TOCropView.h already depends on, and imported with the same
conditional form used for TOCropViewConstants.h.

The test bundle's bridging header previously imported TOCropOverlayView.h
directly to work around this. That workaround is removed, which makes the
existing Swift test the regression guard: without the import in TOCropView.h,
CropViewControllerTests.swift no longer compiles.
@TimOliver
TimOliver force-pushed the fix/public-overlay-header branch from 76a7d9c to 6d5c5df Compare July 28, 2026 15:25
@TimOliver
TimOliver merged commit a1845da into main Jul 28, 2026
1 check passed
@TimOliver
TimOliver deleted the fix/public-overlay-header branch July 28, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant