Check if guided access is activated

In my app I want to check if guided access is activated by the user (3 clicks on the home button).
Is there a way to do this?

In Objective-C there is a declaration:
BOOL UIAccessibilityIsGuidedAccessEnabled(void);

I tried to translated it into a declare function, but it is not working:

Declare Function UIAccessibilityIsGuidedAccessEnabled Lib “UIKit” Selector “UIAccessibilityIsGuidedAccessEnabled” (classRef As Ptr) As Boolean
Return UIAccessibilityIsGuidedAccessEnabled(Nil)

The declare might be

Declare Function UIAccessibilityIsGuidedAccessEnabled Lib "UIKit" As Boolean if UIAccessibilityIsGuidedAccessEnabled then //Guided access enabled end if

EDIT my declare works as expected.

It’s working! Thanks!

Is there maybe also a way to detect if guided access is turned on?