diff --git a/ios/src/Extensions+Init/UIMenu+Init.swift b/ios/src/Extensions+Init/UIMenu+Init.swift index a2c8e7e2..7783d33a 100644 --- a/ios/src/Extensions+Init/UIMenu+Init.swift +++ b/ios/src/Extensions+Init/UIMenu+Init.swift @@ -19,6 +19,7 @@ extension UIMenu.Options { }; }; +#if !targetEnvironment(macCatalyst) #if swift(>=5.7) @available(iOS 16, *) extension UIMenu.ElementSize { @@ -33,4 +34,4 @@ extension UIMenu.ElementSize { }; }; #endif - +#endif diff --git a/ios/src/Extensions+Init/UIMenuElement+Init.swift b/ios/src/Extensions+Init/UIMenuElement+Init.swift index 44d44337..2b375dcb 100644 --- a/ios/src/Extensions+Init/UIMenuElement+Init.swift +++ b/ios/src/Extensions+Init/UIMenuElement+Init.swift @@ -15,11 +15,13 @@ extension UIMenuElement.Attributes { case "disabled" : self = .disabled; case "destructive": self = .destructive; + #if !targetEnvironment(macCatalyst) #if swift(>=5.7) case "keepsMenuPresented": guard #available(iOS 16.0, *) else { return nil }; self = .keepsMenuPresented #endif + #endif default: return nil; }; diff --git a/ios/src/ReactNative/RNIContextMenu/RNIMenuItem.swift b/ios/src/ReactNative/RNIContextMenu/RNIMenuItem.swift index 71ab1980..b7890042 100644 --- a/ios/src/ReactNative/RNIContextMenu/RNIMenuItem.swift +++ b/ios/src/ReactNative/RNIContextMenu/RNIMenuItem.swift @@ -119,6 +119,7 @@ extension RNIMenuItem { ); }; + #if !targetEnvironment(macCatalyst) #if swift(>=5.7) @available(iOS 16.0, *) var synthesizedPreferredMenuElementSize: UIMenu.ElementSize? { @@ -128,6 +129,7 @@ extension RNIMenuItem { return UIMenu.ElementSize(string: menuPreferredElementSize); }; #endif + #endif }; // MARK: - Functions @@ -163,6 +165,7 @@ extension RNIMenuItem { }; #endif + #if !targetEnvironment(macCatalyst) #if swift(>=5.7) if #available(iOS 16.0, *), let preferredElementSize = self.synthesizedPreferredMenuElementSize { @@ -170,6 +173,7 @@ extension RNIMenuItem { menu.preferredElementSize = preferredElementSize; }; #endif + #endif return menu; };