object:getNativeProperty()

Type Function
Object NativeDisplayObject
Library native.*
Return value Lua values compatible with Obj-C
Revision 2017.3178
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 UIWebView.

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" )