Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search for any UIWebView component usage inside a current project?

when submitting my latest build, Apple has response with this warning.

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

Fyi, I already migrate all UIWebView component to WKWebView component in my project based on Apple recommendation but Apple still response with the same warning.

Is there any ways to search for any UIWebView element that still attached to my project other that using Search functionality inside Xcode?

like image 631
Blurzschyter Avatar asked Sep 25 '19 04:09

Blurzschyter


People also ask

Can I still use UIWebView?

New apps containing these frameworks are no longer accepted by the App Store. And last year, we announced that the App Store will no longer accept app updates containing UIWebView as of December 2020.

Is UIWebView deprecated?

Apple is phasing out UIWebView, which is used by developers for integrating web content into an app in a quick and secure manner. Apple is replacing UIWebView (and WebView) with WKWebView, an updated version, as UIWebView has been deprecated.

What is Apple UIWebView?

A view that embeds web content in your app.

How do I remove UIWebView from pod?

Try to do the follows: Add new row and set a key and value in your info. plist to use WKWebView instead of UIWebView.


2 Answers

You can find by using below command lines in your project.

$ cd yourprojectpath

$ grep -r "UIWebView" .
like image 51
ShigaSuresh Avatar answered Nov 15 '22 13:11

ShigaSuresh


grep -r UIWebView works fine for sources but partially for 3rd party binaries because from one side they can contain references, comments or string data with UIWebView without actually using the API and from the other they can use it but doesn't have any reference about.

To check binaries (app, static libs or dynamic frameworks) you should get symbols table with nm (llvm symbol table dumper) e.g.:

nm staticlib.a | grep UIWebView
0000000100117c38 t +[UIWebView(SCORVCE) load]
0000000100117c30 t +[UIWebView_SCORVCE_Importer import]
0000000100117ea4 t -[UIWebView(SCORVCE) vce_delegate]
0000000100117d54 t -[UIWebView(SCORVCE) vce_setDelegate:]
000000010012880c t -[VCETrack setUsingUIWebView:]
00000001001287fc t -[VCETrack usingUIWebView]
                 U _OBJC_CLASS_$_UIWebView
0000000100640668 s _OBJC_CLASS_$_UIWebView_SCORVCE_Importer
0000000100639f88 s _OBJC_IVAR_$_VCETrack._usingUIWebView
0000000100640640 s _OBJC_METACLASS_$_UIWebView_SCORVCE_Importer
0000000100117ca0 t ___26+[UIWebView(SCORVCE) load]_block_invoke

For frameworks you should do the same with its binary file:

nm MyFramework.framework/MyFramework | grep UIWebView

Finally to be sure that the app doesn't use UIWebView you should make an archive then find your app file (YourApp.app) and run next script inside:

# Check the app with static libraries
echo "YourApp"
nm YourApp | grep UIWebView

# Check dynamic frameworks
for framework in Frameworks/*.framework; do
  fname=$(basename $framework .framework)
  echo $fname".framework"
  nm $framework/$fname | grep UIWebView
done
like image 40
iUrii Avatar answered Nov 15 '22 11:11

iUrii