Skip to content

Commit 227507a

Browse files
Fixed iOS 13 requirements for user interface idiom and UIWindow access for FAPanels.
1 parent 21610ab commit 227507a

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

FAPanels.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.swift_version = '5.0'
33
s.name = 'FAPanels'
4-
s.version = '2.0.0'
4+
s.version = '2.0.1'
55
s.summary = 'Swift Panels with Animations'
66

77
s.description = <<-DESC

FAPanels.xcodeproj/project.pbxproj

+2-3
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,6 @@
614614
TargetAttributes = {
615615
29641F6C1EEC1A5500E41BA5 = {
616616
CreatedOnToolsVersion = 8.3.2;
617-
DevelopmentTeam = 664343KK2F;
618617
LastSwiftMigration = 1020;
619618
ProvisioningStyle = Automatic;
620619
};
@@ -965,7 +964,7 @@
965964
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
966965
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
967966
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
968-
DEVELOPMENT_TEAM = 664343KK2F;
967+
DEVELOPMENT_TEAM = "";
969968
INFOPLIST_FILE = FAPanels/Info.plist;
970969
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
971970
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -983,7 +982,7 @@
983982
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
984983
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
985984
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
986-
DEVELOPMENT_TEAM = 664343KK2F;
985+
DEVELOPMENT_TEAM = "";
987986
INFOPLIST_FILE = FAPanels/Info.plist;
988987
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
989988
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

FAPanels/Classes/FAPanel+Animations.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ extension FAPanelController {
838838

839839
internal func handleScrollsToTopForContainers(centerEnabled: Bool, leftEnabled:Bool, rightEnabled:Bool) {
840840

841-
if (UI_USER_INTERFACE_IDIOM() == .phone) {
841+
if UIDevice().userInterfaceIdiom == .phone {
842842

843843
_ = handleScrollsToTop(enabled: centerEnabled, forView: centerPanelContainer)
844844
_ = handleScrollsToTop(enabled: leftEnabled, forView: leftPanelContainer)

FAPanels/Classes/UIViewController+FAPanel.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ public extension UIViewController {
8080
UIColor.black.set()
8181
context.fill(screenRect);
8282

83-
let window: UIWindow = UIApplication.shared.keyWindow!
84-
window.layer.render(in: context)
83+
var window: UIWindow? = nil
84+
if #available(iOS 13.0, *) {
85+
window = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
86+
} else {
87+
window = UIApplication.shared.keyWindow!
88+
}
89+
window?.layer.render(in: context)
8590

8691
let snapshot: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
8792
UIGraphicsEndImageContext()

0 commit comments

Comments
 (0)