From 89f157348f2f4583e9f5bea074d7b3815a5b2012 Mon Sep 17 00:00:00 2001 From: Andreas Zeitler Date: Tue, 6 Dec 2022 23:09:29 +0100 Subject: [PATCH 1/2] add: alertViewBackgroundWidth --- SCLAlertView/SCLAlertView.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SCLAlertView/SCLAlertView.m b/SCLAlertView/SCLAlertView.m index 20a22dc..d9f6962 100755 --- a/SCLAlertView/SCLAlertView.m +++ b/SCLAlertView/SCLAlertView.m @@ -1161,6 +1161,18 @@ - (SCLForceHideBlock)forceHideBlock:(SCLForceHideBlock)forceHideBlock - (CGRect)mainScreenFrame { + if (_rootViewController) { + if ([_rootViewController respondsToSelector:@selector(alertViewBackgroundWidth)]) { + NSInvocationOperation *invo = [[NSInvocationOperation alloc] initWithTarget:_rootViewController selector:@selector(alertViewBackgroundWidth) object:nil]; + [invo start]; + CGFloat width = 0; + [invo.result getValue:&width]; + CGRect rect = [UIApplication sharedApplication].keyWindow.bounds; + rect.size.width = width; + return rect; + } + } + return [self isAppExtension] ? _extensionBounds : [UIApplication sharedApplication].keyWindow.bounds; } From 600c2678724f3dfe79b3d91d68938ca11c48d8b3 Mon Sep 17 00:00:00 2001 From: Andreas Zeitler Date: Tue, 6 Dec 2022 23:10:54 +0100 Subject: [PATCH 2/2] add: alertViewBackgroundWidth delegate method --- CHANGELOG.md | 5 +++++ SCLAlertView-Objective-C.podspec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2022b3b..47ecbc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 1.2.1 unreleased + +* add: alertViewBackgroundWidth delegate method + + ## [1.1.4](https://github.com/dogo/SCLAlertView/tree/1.1.4) (2018-06-19) [Full Changelog](https://github.com/dogo/SCLAlertView/compare/1.1.3...1.1.4) diff --git a/SCLAlertView-Objective-C.podspec b/SCLAlertView-Objective-C.podspec index cfb5881..e69b0d1 100644 --- a/SCLAlertView-Objective-C.podspec +++ b/SCLAlertView-Objective-C.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "SCLAlertView-Objective-C" - spec.version = "1.2.0" + spec.version = "1.2.1" spec.summary = "Beautiful animated Alert View. Written in Swift but ported to Objective-C" spec.homepage = "https://github.com/dogo/SCLAlertView" spec.screenshots = "https://raw.githubusercontent.com/dogo/SCLAlertView/master/ScreenShots/ScreenShot.png", "https://raw.githubusercontent.com/dogo/SCLAlertView/master/ScreenShots/ScreenShot2.png"