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

GCVirtualControllerConfiguration missing iOS 17 hidden attribute #20389

Closed
kiddkaffeine opened this issue Apr 1, 2024 · 1 comment · Fixed by #20401
Closed

GCVirtualControllerConfiguration missing iOS 17 hidden attribute #20389

kiddkaffeine opened this issue Apr 1, 2024 · 1 comment · Fixed by #20401
Labels
good first issue This is a good first issue for someone to start working with our code missing-api-bindings
Milestone

Comments

@kiddkaffeine
Copy link

GCVirtualControllerConfiguration adds a "hidden" attribute in iOS 17, but this does not seem to exist in Xamarin/NET8 versions of the library.

See: https://developer.apple.com/documentation/gamecontroller/gcvirtualcontrollerconfiguration?language=objc

Steps to Reproduce

Attempt to use the hidden attribute in GCVirtualControllerConfiguration.

Expected Behavior

Value can be set/hidden.

Actual Behavior

Value does not exist.

Environment

New for iOS 17.

@dalexsoto dalexsoto added good first issue This is a good first issue for someone to start working with our code api-bindings labels Apr 4, 2024
@dalexsoto dalexsoto added this to the Future milestone Apr 4, 2024
@dalexsoto
Copy link
Member

Thank you for your request, we will try to include this in the next Xcode 15.3 release.

as a workaround you can do this

using ObjCRuntime;
using GameController;
using System.Runtime.InteropServices;

[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")]
public unsafe extern static byte bool_objc_msgSend (IntPtr receiver, IntPtr selector);

[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")]
public unsafe extern static void void_objc_msgSend_bool (IntPtr receiver, IntPtr selector, byte arg1);

public static bool GetHidden (GCVirtualControllerConfiguration controllerConfiguration)
{
	return bool_objc_msgSend (controllerConfiguration.Handle, Selector.GetHandle ("isHidden")) != 0;
}

public static void SetHidden (GCVirtualControllerConfiguration controllerConfiguration, bool hidden)
{
	void_objc_msgSend_bool (controllerConfiguration.Handle, Selector.GetHandle ("setHidden:"), hidden ? (byte) 1 : (byte) 0);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This is a good first issue for someone to start working with our code missing-api-bindings
Projects
None yet
2 participants