Skip to content

Commit

Permalink
iOS UIImpactFeedbackGenerator should be used on iOS 17.5 and up (dotn…
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis authored Oct 29, 2024
1 parent ad6f752 commit 8f0e4d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Essentials/src/HapticFeedback/HapticFeedback.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public void Perform(HapticFeedbackType type)
void Click()
{
UIImpactFeedbackGenerator impact;
#if IOS17_4_OR_GREATER || MACCATALYST17_4_OR_GREATER
if (OperatingSystem.IsIOSVersionAtLeast(17, 4) || OperatingSystem.IsMacCatalystVersionAtLeast(17, 4))
#if IOS17_5_OR_GREATER || MACCATALYST17_5_OR_GREATER
if (OperatingSystem.IsIOSVersionAtLeast(17, 5) || OperatingSystem.IsMacCatalystVersionAtLeast(17, 5))
{
impact = UIImpactFeedbackGenerator.GetFeedbackGenerator(UIImpactFeedbackStyle.Light, new UIView());
}
Expand All @@ -41,8 +41,8 @@ void Click()
void LongPress()
{
UIImpactFeedbackGenerator impact;
#if IOS17_4_OR_GREATER || MACCATALYST17_4_OR_GREATER
if (OperatingSystem.IsIOSVersionAtLeast(17, 4) || OperatingSystem.IsMacCatalystVersionAtLeast(17, 4))
#if IOS17_5_OR_GREATER || MACCATALYST17_5_OR_GREATER
if (OperatingSystem.IsIOSVersionAtLeast(17, 5) || OperatingSystem.IsMacCatalystVersionAtLeast(17, 5))
{
impact = UIImpactFeedbackGenerator.GetFeedbackGenerator(UIImpactFeedbackStyle.Medium, new UIView());
}
Expand Down

0 comments on commit 8f0e4d1

Please sign in to comment.