Skip to content

Commit

Permalink
Add support for iOS 13 (#1)
Browse files Browse the repository at this point in the history
* Add support for iOS 13 changes on UIWindow management

* update travis

* Update podspec to version 2.3.1
  • Loading branch information
Ahmed Mohamed Abdelmagied authored Dec 5, 2019
1 parent cdb0613 commit e6431b8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9
osx_image: xcode11.2
script:
- xcodebuild clean build test -workspace ActionSheetPicker-3.0.xcworkspace -scheme ActionSheetPicker -sdk iphonesimulator -destination "platform=iOS Simulator,OS=11.0,name=iPhone X" ONLY_ACTIVE_ARCH=NO

Expand Down
2 changes: 1 addition & 1 deletion ActionSheetPicker-3.0.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do | s |
s.name = 'ActionSheetPicker-3.0'
s.version = '2.3.0'
s.version = '2.3.1'
s.summary = 'Better version of ActionSheetPicker with support iOS7 and other improvements.'
s.homepage = 'http://skywinder.github.io/ActionSheetPicker-3.0'
s.license = 'BSD'
Expand Down
26 changes: 19 additions & 7 deletions Pickers/SWActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,25 @@ - (UIWindow *)window
}
else
{
return SWActionSheetWindow = ({
UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
window.windowLevel = self.windowLevel;
window.backgroundColor = [UIColor clearColor];
window.rootViewController = [SWActionSheetVC new];
window;
});
UIWindow *window = nil;
if (@available(iOS 13.0, *)) {
UIScene *scene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject;
if (scene && [scene isKindOfClass:[UIWindowScene class]]) {
UIWindowScene *windowScene = (UIWindowScene *)scene;
window = [[UIWindow alloc] initWithWindowScene:windowScene];
}
}

if (window == nil) {
window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
}

window.windowLevel = self.windowLevel;
window.backgroundColor = [UIColor clearColor];
window.rootViewController = [SWActionSheetVC new];

SWActionSheetWindow = window;
return SWActionSheetWindow;
}
}

Expand Down

0 comments on commit e6431b8

Please sign in to comment.