Declare for NSString *const?

i’m wondering how to make a declare for this Objective-C code:

NSString *const UIApplicationOpenSettingsURLString;

https://developer.apple.com/documentation/uikit/uiapplicationopensettingsurlstring?language=objc

Tried the following:

Soft Declare Function UIApplicationOpenSettingsURLString Lib "UIKit" () As CFStringRef
Var url_to_settings As String = UIApplicationOpenSettingsURLString(sharedApp)

Alternatively tried to use a selector but i get an error saying a selector requires at least 1 parameter obj As ptr perhaps. the apple docs say “Global Variable” so i guess it’s not class/instance based?

Have a look at OpeniOSSettingsXC in iOSDesignExtensions to see how it is done.

Or Foundation.StringConstant in iOSKit.

You must first load the framework, then load the constant and finally get its value.

1 Like

You will need to use CFBundleGetDataPointerForName function from CFBundle.h

thanks i think an alternative solution may work better @Christian_Schmitz do you have ios wifi settings classes?

Sorry, I don’t think we have that currently.
But of course we could add it for a future plugin version.

1 Like