From 6f84dcf2e31c2fb9b2c1205f02d199d0842850ef Mon Sep 17 00:00:00 2001 From: Aleh Dzenisiuk Date: Tue, 13 Aug 2024 11:50:33 +0200 Subject: [PATCH] Fix incorrect call in mmm_imageFromPDFNamed:tintColor: --- MMMCommonUI.podspec | 2 +- .../MMMCommonUI/UIViewController+MMMNavigationStack.swift | 2 +- Sources/MMMCommonUIObjC/MMMCommonUIMisc.h | 4 ++-- Sources/MMMCommonUIObjC/MMMCommonUIMisc.m | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MMMCommonUI.podspec b/MMMCommonUI.podspec index ab1926c..1c1f845 100644 --- a/MMMCommonUI.podspec +++ b/MMMCommonUI.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.name = "MMMCommonUI" - s.version = "3.12.1" + s.version = "3.12.2" s.summary = "Small UI-related pieces reused in many components from MMMTemple" s.description = "#{s.summary}." s.homepage = "https://github.com/mediamonks/#{s.name}" diff --git a/Sources/MMMCommonUI/UIViewController+MMMNavigationStack.swift b/Sources/MMMCommonUI/UIViewController+MMMNavigationStack.swift index c1022a8..7067439 100644 --- a/Sources/MMMCommonUI/UIViewController+MMMNavigationStack.swift +++ b/Sources/MMMCommonUI/UIViewController+MMMNavigationStack.swift @@ -215,7 +215,7 @@ private class MMMNavigationStackHelper: NSObject, MMMNavigationStackItemDelegate // The record is already removed as part of the pop request, nothing to do here. return } else { - MMMLogError(self, "Trying to remove a record for a \(MMMTypeName(viewController)) while popping a different instance (\(MMMTypeName(recordPoppingNow.viewController)))") + MMMLogError(self, "Trying to remove a record for a \(MMMTypeName(viewController)) while popping a different instance (\(MMMTypeName(recordPoppingNow.viewController as Any)))") assertionFailure() // It would be a weird case, but let it continue in production. } diff --git a/Sources/MMMCommonUIObjC/MMMCommonUIMisc.h b/Sources/MMMCommonUIObjC/MMMCommonUIMisc.h index 44747e5..1348afe 100644 --- a/Sources/MMMCommonUIObjC/MMMCommonUIMisc.h +++ b/Sources/MMMCommonUIObjC/MMMCommonUIMisc.h @@ -266,7 +266,7 @@ extern NSAttributedStringKey const MMMCaseTransformAttributeName NS_SWIFT_NAME(c * specified view. It's always greater than or equal to zero. * It can be used to manually adjust the insets of a scroll view which is covered by the status bar. */ -extern CGFloat MMMHeightOfAreaCoveredByStatusBar(UIView *view, CGRect rect); +extern CGFloat MMMHeightOfAreaCoveredByStatusBar(UIView *view, CGRect rect) DEPRECATED_ATTRIBUTE; // // @@ -349,7 +349,7 @@ extern CGFloat MMMPhaseForDashedPattern(CGFloat lineLength, CGFloat dashLength, extern void MMMAddDashedCircle(CGPoint center, CGFloat radius, CGFloat dashLength, CGFloat skipLength); /** YES, if running under Fastlane's Snapshot tool. */ -static inline BOOL MMMIsRunningUnderFastlane() { +static inline BOOL MMMIsRunningUnderFastlane(void) { #if DEBUG diff --git a/Sources/MMMCommonUIObjC/MMMCommonUIMisc.m b/Sources/MMMCommonUIObjC/MMMCommonUIMisc.m index 3488a17..7929bef 100644 --- a/Sources/MMMCommonUIObjC/MMMCommonUIMisc.m +++ b/Sources/MMMCommonUIObjC/MMMCommonUIMisc.m @@ -73,7 +73,7 @@ void MMMDrawBorder(CGRect r, UIRectEdge edge, UIColor *color, CGFloat width) { CGContextStrokePath(c); } -CGFloat MMMPixelScale() { +CGFloat MMMPixelScale(void) { static CGFloat scale = 1; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -338,7 +338,7 @@ CGFloat MMMHeightOfAreaCoveredByStatusBar(UIView *view, CGRect rect) { // This is to work around the problem with UI rotations: it is possible that the status bar is still portrait // while the view is already landscape, and it can also be hidden (zero height); // in this case the height calculated as below will be large and will cause layout issues. - // Returning 0 now assumming that the view using this function will eventually recalculate the status bar height + // Returning 0 now assuming that the view using this function will eventually recalculate the status bar height // in response to UIApplicationDidChangeStatusBarFrameNotification. if (CGRectGetHeight(statusBarRect) <= 0 || CGRectGetHeight(statusBarRect) > CGRectGetWidth(statusBarRect)) return 0; @@ -465,7 +465,7 @@ + (UIImage *)mmm_imageFromPDFNamed:(NSString *)name rasterizedForHeight:(CGFloat } + (UIImage *)mmm_imageFromPDFNamed:(NSString *)name tintColor:(UIColor *)tintColor { - return [self mmm_cacheKeyForNamed:name height:0 tintColor:tintColor]; + return [self mmm_imageFromPDFNamed:name rasterizedForHeight:0 tintColor:tintColor]; } + (UIImage *)mmm_imageFromPDFNamed:(NSString *)name rasterizedForHeight:(CGFloat)height {