Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
x.y.z Release Notes (yyyy-MM-dd)
=============================================================

2.8.0 Release Notes (2025-09-23)
=============================================================

## Added

- Deprecated iOS 11 as it no longer supported in Xcode 26.

## Fixed

- A bug in iOS 26 where the toolbar buttons would appear misaligned.

2.7.4 Release Notes (2024-05-08)
=============================================================

Expand Down
2 changes: 1 addition & 1 deletion CropViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/TimOliver/TOCropViewController'
s.author = 'Tim Oliver'
s.source = { :git => 'https://github.com/TimOliver/TOCropViewController.git', :tag => s.version }
s.platform = :ios, '11.0'
s.platform = :ios, '12.0'
s.source_files = 'Swift/CropViewController/**/*.{h,swift}', 'Objective-C/TOCropViewController/**/*.{h,m}'
s.exclude_files = 'Objective-C/TOCropViewController/include/**/*.h'
s.resource_bundles = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// UIImage+CropRotate.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// UIImage+CropRotate.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropViewConstants.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOActivityCroppedImageProvider.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOActivityCroppedImageProvider.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropViewControllerTransitioning.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropViewControllerTransitioning.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -79,11 +79,8 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC
if ((self.isDismissing && !CGRectIsEmpty(self.toFrame)) || (!self.isDismissing && !CGRectIsEmpty(self.fromFrame))) {
imageView = [[UIImageView alloc] initWithImage:self.image];
imageView.frame = self.fromFrame;
imageView.accessibilityIgnoresInvertColors = YES;
[containerView addSubview:imageView];

if (@available(iOS 11.0, *)) {
imageView.accessibilityIgnoresInvertColors = YES;
}
}

cropViewController.view.alpha = (self.isDismissing ? 1.0f : 0.0f);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCroppedImageAttributes.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCroppedImageAttributes.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/TOCropViewController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropViewController.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
43 changes: 14 additions & 29 deletions Objective-C/TOCropViewController/TOCropViewController.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropViewController.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -350,10 +350,7 @@ - (CGRect)frameForTitleLabelWithSize:(CGSize)size verticalLayout:(BOOL)verticalL
// Adjust for landscape layout
if (!verticalLayout) {
x = kTOCropViewControllerTitleTopPadding;
if (@available(iOS 11.0, *)) {
x += self.view.safeAreaInsets.left;
}

x += self.view.safeAreaInsets.left;
viewWidth -= x;
}

Expand All @@ -362,12 +359,7 @@ - (CGRect)frameForTitleLabelWithSize:(CGSize)size verticalLayout:(BOOL)verticalL
if (!verticalLayout) { frame.origin.x += x; }

// Work out vertical position
if (@available(iOS 11.0, *)) {
frame.origin.y = self.view.safeAreaInsets.top + kTOCropViewControllerTitleTopPadding;
}
else {
frame.origin.y = self.statusBarHeight + kTOCropViewControllerTitleTopPadding;
}
frame.origin.y = self.view.safeAreaInsets.top + kTOCropViewControllerTitleTopPadding;

return frame;
}
Expand Down Expand Up @@ -409,24 +401,17 @@ - (void)adjustToolbarInsets
{
UIEdgeInsets insets = UIEdgeInsetsZero;

if (@available(iOS 11.0, *)) {
// Add padding to the left in landscape mode
if (!self.verticalLayout) {
insets.left = self.view.safeAreaInsets.left;
}
else {
// Add padding on top if in vertical and tool bar is at the top
if (self.toolbarPosition == TOCropViewControllerToolbarPositionTop) {
insets.top = self.view.safeAreaInsets.top;
}
else { // Add padding to the bottom otherwise
insets.bottom = self.view.safeAreaInsets.bottom;
}
}
// Add padding to the left in landscape mode
if (!self.verticalLayout) {
insets.left = self.view.safeAreaInsets.left;
}
else { // iOS <= 10
if (!self.statusBarHidden && self.toolbarPosition == TOCropViewControllerToolbarPositionTop) {
insets.top = self.statusBarHeight;
else {
// Add padding on top if in vertical and tool bar is at the top
if (self.toolbarPosition == TOCropViewControllerToolbarPositionTop) {
insets.top = self.view.safeAreaInsets.top;
}
else { // Add padding to the bottom otherwise
insets.bottom = self.view.safeAreaInsets.bottom;
}
}

Expand Down Expand Up @@ -511,7 +496,7 @@ - (void)_willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInt
[sublayer removeAllAnimations];
}

// On iOS 11, since these layout calls are done multiple times, if we don't aggregate from the
// On iOS 11 and up, since these layout calls are done multiple times, if we don't aggregate from the
// current state, the animation breaks.
[UIView animateWithDuration:duration
delay:0.0f
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/Views/TOCropOverlayView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropOverlayView.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/Views/TOCropOverlayView.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropOverlayView.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/Views/TOCropScrollView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropScrollView
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/Views/TOCropScrollView.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropScrollView
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/Views/TOCropToolbar.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropToolbar.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
15 changes: 5 additions & 10 deletions Objective-C/TOCropViewController/Views/TOCropToolbar.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropToolbar.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -57,14 +57,9 @@ - (void)setup {
self.backgroundView.backgroundColor = [UIColor colorWithWhite:0.12f alpha:1.0f];
[self addSubview:self.backgroundView];

// On iOS 9, we can use the new layout features to determine whether we're in an 'Arabic' style language mode
if (@available(iOS 9.0, *)) {
_reverseContentLayout = ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft);
}
else {
_reverseContentLayout = [[[NSLocale preferredLanguages] objectAtIndex:0] hasPrefix:@"ar"];
}

// On iOS 9 and up, we can use the new layout features to determine whether we're in an 'Arabic' style language mode
_reverseContentLayout = ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft);

// Get the resource bundle depending on the framework/dependency manager we're using
NSBundle *resourceBundle = TO_CROP_VIEW_RESOURCE_BUNDLE_FOR_OBJECT(self);

Expand Down Expand Up @@ -294,7 +289,7 @@ - (void)layoutToolbarButtons:(NSArray *)buttons withSameButtonSize:(CGSize)size

for (NSInteger i = 0; i < count; i++) {
UIButton *button = buttons[i];
CGFloat sameOffset = horizontally ? fabs(CGRectGetHeight(containerRect)-44.0f) : fabs(CGRectGetWidth(containerRect)-CGRectGetWidth(button.bounds));
CGFloat sameOffset = horizontally ? fabs(CGRectGetHeight(containerRect)-44.0f) : fabs(CGRectGetWidth(containerRect)-size.width);
CGFloat diffOffset = padding + i * (fixedSize + padding);
CGPoint origin = horizontally ? CGPointMake(diffOffset, sameOffset) : CGPointMake(sameOffset, diffOffset);
if (horizontally) {
Expand Down
2 changes: 1 addition & 1 deletion Objective-C/TOCropViewController/Views/TOCropView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropView.h
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down
16 changes: 5 additions & 11 deletions Objective-C/TOCropViewController/Views/TOCropView.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// TOCropView.m
//
// Copyright 2015-2024 Timothy Oliver. All rights reserved.
// Copyright 2015-2025 Timothy Oliver. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -163,11 +163,7 @@ - (void)setup
self.scrollView.delegate = self;
[self addSubview:self.scrollView];

// Disable smart inset behavior in iOS 11
if (@available(iOS 11.0, *)) {
self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}

self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
self.scrollView.touchesBegan = ^{ [weakSelf startEditing]; };
self.scrollView.touchesEnded = ^{ [weakSelf startResetTimer]; };

Expand Down Expand Up @@ -216,11 +212,9 @@ - (void)setup
[self.foregroundContainerView addSubview:self.foregroundImageView];

// Disable colour inversion for the image views
if (@available(iOS 11.0, *)) {
self.foregroundImageView.accessibilityIgnoresInvertColors = YES;
self.backgroundImageView.accessibilityIgnoresInvertColors = YES;
}

self.foregroundImageView.accessibilityIgnoresInvertColors = YES;
self.backgroundImageView.accessibilityIgnoresInvertColors = YES;

// The following setup isn't needed during circular cropping
if (circularMode) { return; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24408" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_54" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24402"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -14,8 +14,8 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="688"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015-2024 Tim Oliver. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="613" width="440" height="21"/>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015-2025 Tim Oliver. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="579" width="440" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
Expand Down
5 changes: 1 addition & 4 deletions Objective-C/TOCropViewControllerExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,9 @@ - (void)viewDidLoad {
self.imageView = [[UIImageView alloc] init];
self.imageView.userInteractionEnabled = YES;
self.imageView.contentMode = UIViewContentModeScaleAspectFit;
self.imageView.accessibilityIgnoresInvertColors = YES;
[self.view addSubview:self.imageView];

if (@available(iOS 11.0, *)) {
self.imageView.accessibilityIgnoresInvertColors = YES;
}

UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapImageView)];
[self.imageView addGestureRecognizer:tapRecognizer];
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _Looking for something more? If `TOCropViewController` doesn't meet your exact r
* Localized in 28 languages.

## System Requirements
iOS 11.0 or above
iOS 12.0 or above

## Installation

Expand Down
6 changes: 1 addition & 5 deletions Swift/CropViewController/CropViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,7 @@ open class CropViewController: UIViewController, TOCropViewControllerDelegate {
}

open override var preferredScreenEdgesDeferringSystemGestures: UIRectEdge {
if #available(iOS 11.0, *) {
return toCropViewController.preferredScreenEdgesDeferringSystemGestures
}

return UIRectEdge.all
return toCropViewController.preferredScreenEdgesDeferringSystemGestures
}

// ------------------------------------------------
Expand Down
Loading