Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass deprecation warning #47

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HammerTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "HammerTests"
spec.version = "0.14.1"
spec.version = "0.14.2"
spec.summary = "iOS touch and keyboard syntheis library for unit tests."
spec.description = "Hammer is a touch and keyboard synthesis library for emulating user interaction events. It enables new ways of triggering UI actions in unit tests, replicating a real world environment as much as possible."
spec.homepage = "https://github.com/lyft/Hammer"
Expand Down
9 changes: 8 additions & 1 deletion Sources/Hammer/EventGenerator/EventGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public final class EventGenerator {

/// Returns if the window is ready to receive user interaction events
public var isWindowReady: Bool {
guard !UIApplication.shared.isIgnoringInteractionEvents
guard !(UIApplication.shared as UIApplicationDeprecated).isIgnoringInteractionEvents
&& self.window.isHidden == false
&& self.window.isUserInteractionEnabled
&& self.window.rootViewController?.viewIfLoaded != nil
Expand Down Expand Up @@ -183,3 +183,10 @@ public final class EventGenerator {
try waiter.start()
}
}

// Bypasses deprecation warning for `isIgnoringInteractionEvents`
private protocol UIApplicationDeprecated {
var isIgnoringInteractionEvents: Bool { get }
}

extension UIApplication: UIApplicationDeprecated {}