forked from microsoft/fluentui-apple
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for crashes while adding UIPointerInteraction instance (microsoft…
…#272) * Fix for crash while adding UIPointerInteraction to TabBarView. * Covering other controls in the same scenario. * no message * no message * no message
- Loading branch information
Showing
5 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Pointer Interaction APIs check | ||
|
||
/// Some beta versions of iOS 13.4 and later don't include the pointer interaction APIs. | ||
/// Checking the UIButton's isPointerInteractionEnabled property is a workaround that prevents a crash due to an | ||
/// exception thrown while trying to add the UIPointerInteraction instance while running on those iOS versions: | ||
/// "uncaught ObjC exception, reason: Invalid parameter not satisfying: interaction" | ||
/// - Returns: true if Pointer Interaction APIs are available, otherwise false | ||
@available(iOS 13.4, *) | ||
func arePointerInteractionAPIsAvailable() -> Bool { | ||
return UIButton.instancesRespond(to: Selector(("isPointerInteractionEnabled"))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters