Skip to content

Additional polishing and refinement - #651

Merged
TimOliver merged 9 commits into
mainfrom
split/5-api-correctness
Jul 28, 2026
Merged

Additional polishing and refinement#651
TimOliver merged 9 commits into
mainfrom
split/5-api-correctness

Conversation

@TimOliver

Copy link
Copy Markdown
Owner

No description provided.

The re-entry guard only disabled the text button, which doesn't exist
on iOS 26 (and is hidden in icon-only layouts), leaving the visible
icon button able to fire a second didCrop callback.
Cropping an HDR photo silently tone-mapped it to SDR because the
default renderer format doesn't support high dynamic range. When the
source reports HDR, an HDR-capable format is now requested (iOS 17+,
guarded so unsupported environments keep the existing behavior).

The category implementation also now matches its declared name
(TOCropRotate), and the header doc correctly describes the crop rect
as point space.
…bugs

- doneButtonTitle, cancelButtonTitle, showOnlyIcons, doneButtonColor,
  cancelButtonColor and resetButtonHidden had forwarding setters but
  auto-synthesized getters reading a never-written ivar, so they always
  read back as their defaults
- presentAnimatedFromParentViewController: tested self.angle instead of
  its angle parameter (typo dating to 2016), silently dropping the
  angle when restoring a rotation-only edit with an empty toImageFrame
- The rotation heuristic now derives the target layout from the aspect
  of the destination size instead of a width delta, fixing spurious
  landscape layouts on Mac Catalyst window resizes and iPad split view
- The aspect-ratio popover now anchors to the clamp button through a
  proper coordinate-space conversion (the button moved inside the glass
  container on iOS 26)
- TOCropViewControllerAspectRatioPreset overrode isEqual: without hash;
  equal presets now hash identically
UIVisualEffectView has existed since iOS 8 and systemFontOfSize:weight:
since 8.2, so their fallbacks were unreachable (and the font guard was
needlessly degrading iOS 12 to a regular-weight Done button).
Recreated grid lines sat at zero-size with full alpha until the next
crop-box move; they now inherit the current grid visibility and are
laid out immediately. Also guards the line-thickness division against
a zero displayScale before the view joins a window.
- Done buttons re-enable after the callbacks are delivered, so hosts that keep
  the controller on screen (eg retry-on-upload-failure) can commit again, via a
  single setDoneButtonsEnabled: rather than poking both buttons at each site
- The resize heuristic uses >= so a square size agrees with -verticalLayout
- Grid-line setters reuse setGridHidden:animated: instead of duplicating it
- Aspect ratio preset hashes mix their components rather than XOR-ing them, so
  symmetric sizes such as 16:9 and 9:16 no longer collide, and the never
  written/read width/height properties are gone
- Dropped the always-true iOS 9 blur-effect check left behind by the iOS 12
  floor sweep, and the misspelled -setRotateCounterClockwiseButtonHidden:,
  which hadn't matched its property (or been called) since 2016
Exercises the ~20 properties CropViewController forwards to the underlying
TOCropViewController, which is what the write-only property fixes above
restored. Kept separate from the delegate-bridge tests because it depends on
those fixes rather than on the bridge.
TOCropView.gridOverlayView is nil for circular cropping, which returns from
-setup before building it, and TOCropToolbar's doneTextButton/cancelTextButton
are nil on iOS 26, where only the icon buttons are created. All three were
declared nonnull, which hands Swift a nil in a non-optional: the added test
assertion traps at runtime without this change.

NOTE: this is source-breaking for Swift callers that access these directly,
which is arguable for a patch release. It is deliberately the last commit on
this branch so it can be dropped with a single revert, leaving the
documentation notes from the preceding commits in place.
Base automatically changed from split/4-ios26-toolbar to main July 28, 2026 14:58
@TimOliver
TimOliver merged commit 334f8a6 into main Jul 28, 2026
1 check passed
pull Bot pushed a commit to jasonkneen/TOCropViewController that referenced this pull request Jul 28, 2026
3.1.2 was already tagged and pushed to CocoaPods trunk on 2026-04-07, so this
work needed a new version number. It's a minor rather than a patch bump because
the release changes public API: TOCropView.gridOverlayView, and TOCropToolbar's
doneTextButton and cancelTextButton, are now annotated nullable, which is
source-breaking for Swift callers that access them directly.

Bumps both podspecs and all four MARKETING_VERSIONs, dates the accumulated
release notes, and links each entry to the pull request it came from (TimOliver#648
through TimOliver#651; the build fix went to main directly and has no PR).

Also moves the TimOliver#636 fix up out of the 3.1.1 section, where it had been filed
after that release went out, and splits it into the two distinct fixes it
actually made. main's 3.1.2 heading gains the underline every other heading in
the file has.
@TimOliver
TimOliver deleted the split/5-api-correctness branch July 28, 2026 15:53
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