diff --git a/CHANGELOG.md b/CHANGELOG.md index 34baea4e..318bf483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) ============================================================= diff --git a/CropViewController.podspec b/CropViewController.podspec index 46cd494d..1cb95821 100644 --- a/CropViewController.podspec +++ b/CropViewController.podspec @@ -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 = { diff --git a/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.h b/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.h index 1ae9e977..7408754d 100644 --- a/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.h +++ b/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.h @@ -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 diff --git a/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.m b/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.m index b2cad97d..e88e61dd 100644 --- a/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.m +++ b/Objective-C/TOCropViewController/Categories/UIImage+CropRotate.m @@ -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 diff --git a/Objective-C/TOCropViewController/Constants/TOCropViewConstants.h b/Objective-C/TOCropViewController/Constants/TOCropViewConstants.h index a3d16599..58b66bb6 100644 --- a/Objective-C/TOCropViewController/Constants/TOCropViewConstants.h +++ b/Objective-C/TOCropViewController/Constants/TOCropViewConstants.h @@ -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 diff --git a/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h b/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h index f6199e47..577fad18 100644 --- a/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h +++ b/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h @@ -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 diff --git a/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.m b/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.m index 578e4a24..04314054 100644 --- a/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.m +++ b/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.m @@ -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 diff --git a/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h b/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h index 445b487b..1a2ac61a 100644 --- a/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h +++ b/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h @@ -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 diff --git a/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.m b/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.m index 3f79f023..bd7edae6 100644 --- a/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.m +++ b/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.m @@ -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 @@ -79,11 +79,8 @@ - (void)animateTransition:(id )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); diff --git a/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h b/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h index d7a8a8a9..39aeb060 100644 --- a/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h +++ b/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h @@ -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 diff --git a/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.m b/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.m index 97ddaf32..56eb2461 100644 --- a/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.m +++ b/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.m @@ -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 diff --git a/Objective-C/TOCropViewController/TOCropViewController.h b/Objective-C/TOCropViewController/TOCropViewController.h index fa658dae..e7fc44ca 100755 --- a/Objective-C/TOCropViewController/TOCropViewController.h +++ b/Objective-C/TOCropViewController/TOCropViewController.h @@ -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 diff --git a/Objective-C/TOCropViewController/TOCropViewController.m b/Objective-C/TOCropViewController/TOCropViewController.m index a8fb131f..44830432 100755 --- a/Objective-C/TOCropViewController/TOCropViewController.m +++ b/Objective-C/TOCropViewController/TOCropViewController.m @@ -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 @@ -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; } @@ -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; } @@ -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; } } @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropOverlayView.h b/Objective-C/TOCropViewController/Views/TOCropOverlayView.h index 295e1114..bf66a10e 100644 --- a/Objective-C/TOCropViewController/Views/TOCropOverlayView.h +++ b/Objective-C/TOCropViewController/Views/TOCropOverlayView.h @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropOverlayView.m b/Objective-C/TOCropViewController/Views/TOCropOverlayView.m index 257432b0..c6962ff3 100644 --- a/Objective-C/TOCropViewController/Views/TOCropOverlayView.m +++ b/Objective-C/TOCropViewController/Views/TOCropOverlayView.m @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropScrollView.h b/Objective-C/TOCropViewController/Views/TOCropScrollView.h index a3805ce7..c6726028 100644 --- a/Objective-C/TOCropViewController/Views/TOCropScrollView.h +++ b/Objective-C/TOCropViewController/Views/TOCropScrollView.h @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropScrollView.m b/Objective-C/TOCropViewController/Views/TOCropScrollView.m index c4594213..b539d374 100644 --- a/Objective-C/TOCropViewController/Views/TOCropScrollView.m +++ b/Objective-C/TOCropViewController/Views/TOCropScrollView.m @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropToolbar.h b/Objective-C/TOCropViewController/Views/TOCropToolbar.h index ff621729..bacc4341 100644 --- a/Objective-C/TOCropViewController/Views/TOCropToolbar.h +++ b/Objective-C/TOCropViewController/Views/TOCropToolbar.h @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropToolbar.m b/Objective-C/TOCropViewController/Views/TOCropToolbar.m index e2a58037..f101c949 100644 --- a/Objective-C/TOCropViewController/Views/TOCropToolbar.m +++ b/Objective-C/TOCropViewController/Views/TOCropToolbar.m @@ -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 @@ -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); @@ -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) { diff --git a/Objective-C/TOCropViewController/Views/TOCropView.h b/Objective-C/TOCropViewController/Views/TOCropView.h index be282964..9708b07f 100755 --- a/Objective-C/TOCropViewController/Views/TOCropView.h +++ b/Objective-C/TOCropViewController/Views/TOCropView.h @@ -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 diff --git a/Objective-C/TOCropViewController/Views/TOCropView.m b/Objective-C/TOCropViewController/Views/TOCropView.m index 8a03c976..b458f8ee 100755 --- a/Objective-C/TOCropViewController/Views/TOCropView.m +++ b/Objective-C/TOCropViewController/Views/TOCropView.m @@ -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 @@ -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]; }; @@ -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; } diff --git a/Objective-C/TOCropViewControllerExample/Base.lproj/LaunchScreen.xib b/Objective-C/TOCropViewControllerExample/Base.lproj/LaunchScreen.xib index bb80b596..ab523e45 100644 --- a/Objective-C/TOCropViewControllerExample/Base.lproj/LaunchScreen.xib +++ b/Objective-C/TOCropViewControllerExample/Base.lproj/LaunchScreen.xib @@ -1,9 +1,9 @@ - - + + - + @@ -14,8 +14,8 @@ - -