object:getNativeProperty()

Type Function
Object NativeDisplayObject
Library native.*
Return value Lua values compatible with Obj-C
Revision Release 2024.3703
Keywords native object, property accessors
See also object:setNativeProperty()

Overview

This function allows you to get properties of the underlying native object created by the native library. For example, if you create a WebView on iOS, you can access the Obj-C properties of the corresponding WKWebView (or WKWebViewConfiguration if called before a request is made).

Gotchas

This is an iOS-only feature.

Syntax

object:getNativeProperty( property )
property (required)

String. The string name for the native property.

Example

local webView = native.newWebView( 0, 0, display.contentWidth, display.contentHeight )
local allows = webView:getNativeProperty( "allowsInlineMediaPlayback" )