diff --git a/uni_modules/uts-get-native-view/utssdk/app-ios/index.uts b/uni_modules/uts-get-native-view/utssdk/app-ios/index.uts index 39fe984eb925d601f3546f92fc8a2d7611501e35..b03c6eb582dd3a0582eda28dd9baf32eef6cb36d 100644 --- a/uni_modules/uts-get-native-view/utssdk/app-ios/index.uts +++ b/uni_modules/uts-get-native-view/utssdk/app-ios/index.uts @@ -1,4 +1,4 @@ -import { CanWebViewGoBack, CanWebViewGoForward } from "../interface"; +import { CanWebViewGoBack, CanWebViewGoForward, HasNativeView } from "../interface"; import { WKWebView } from 'WebKit'; export const canWebViewGoBack : CanWebViewGoBack = function (elementId : string) : boolean { @@ -20,3 +20,13 @@ export const canWebViewGoForward : CanWebViewGoForward = function (elementId : s } return false; } + +export const hasNativeView : HasNativeView = function (elementId : string) : boolean { + // const element = uni.getElementById(elementId) + const element = DCGetElementByID.dcGetElementById(elementId) + const view = element?.getIOSView(); + if (view != null && view instanceof WKWebView) { + return true; + } + return false; +}