Skip to content

Commit cb53c94

Browse files
author
Diogo Autilio
committed
Fix Support iOS 8 Widget frame position dogo#102
1 parent 10ba108 commit cb53c94

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

SCLAlertView/SCLAlertView.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ typedef NS_ENUM(NSInteger, SCLAlertViewBackground)
168168
*/
169169
@property (nonatomic) CGFloat circleIconHeight;
170170

171+
/** Set SCLAlertView extension bounds.
172+
*
173+
* Set new bounds (EXTENSION ONLY)
174+
*/
175+
@property (nonatomic) CGRect extensionBounds;
176+
171177
/** Initialize SCLAlertView using a new window.
172178
*
173179
* Init with new window

SCLAlertView/SCLAlertView.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,12 @@ - (void)alertIsDismissed:(DismissBlock)dismissBlock
10071007

10081008
- (CGRect)mainScreenFrame
10091009
{
1010-
return [UIScreen mainScreen].bounds;
1010+
return [self isAppExtension] ? _extensionBounds : [UIScreen mainScreen].bounds;
1011+
}
1012+
1013+
- (BOOL)isAppExtension
1014+
{
1015+
return [[[NSBundle mainBundle] executablePath] containsString:@".appex/"];
10111016
}
10121017

10131018
#pragma mark - Background Effects

0 commit comments

Comments
 (0)