Regards UIWebView Deprecation

Hi,

I have not used UIWebView in Project , still the issue came up while uploading App to Appstore

issue:-New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability

Can u pls anybody help, how to resolve ..?

Replies

I have not used UIWebView in Project 

I'd bet good money you did...you just don't know it.

Seems each time this has come up in the last few years, it was routinely resolved by (a) identifying all 3rd party APIs/libs and (b) contacting the authors of those products for versions that are not years old and still contain UIWebView(s).

You're working with old stuf, whether you know it or not. Choose to stop the practice of relying on 3rd party products, or get used to having to bootstrap old crap that hasn't been updated in ages- either way, it's on the dev to climb out of a hole.

Use Xcode search to find the offending references so you know who's door to go knocking on.

If however, you are confident your code is clean, file an appeal and push back on review.

Good luck.
In all instances I’m aware of, apps that are getting the UIWebView usage warning are in fact linking to the UIWebView framework. It may be in third party libraries or frameworks. 

Please check again what your app and its libraries link against. You can do so by running the grep command in Terminal. For example,
Open Terminal. Type the following on the command line to change to the directory where your application binary is:

Code Block
cd ~/Library/Developer/Xcode/Archives/<date of your archive>/<your archive>


To search for UIWebView use the following command:

Code Block
grep -R UIWebView *


This should give you a list of files that contain a reference to UIWebView. From that list you should then be able to determine where the UIWebView reference is.

To make this a bit more concrete, the other day I created a test app named SingleViewApp and archived it, so this is what I did to check for the UIWebView:

Code Block
% cd ~/Library/Developer/Xcode/Archives/
% ls
2019-08-26 2020-03-09
% cd 2020-03-09 
% ls
SingleViewApp 3-9-20, 11.38 AM.xcarchive SingleViewApp 3-9-20, 11.41 AM.xcarchive
SingleViewApp 3-9-20, 11.39 AM.xcarchive SingleViewApp 3-9-20, 11.47 AM.xcarchive
% cd "SingleViewApp 3-9-20, 11.47 AM.xcarchive"
% grep -R UIWebView *


Binary file Products/Applications/SingleViewApp.app/Base.lproj/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib matches
Binary file dSYMs/SingleViewApp.app.dSYM/Contents/Resources/DWARF/SingleViewApp matches

So we now know that there are references to UIWebView in the dSYM file and the nib.

Next we need to search the project for where the occurrences of the UIWebView exist.

Go to the folder where your project lives. In my case it was here:

Code Block
cd ~/src/SingleViewApp

Now run the same grep command for UIWebView to determine if there are any occurrences in the project:

Code Block
grep -R UIWebView *

In my case there weren't which means it’s not referenced in code.

Now run a search for UIWebView that will show up in storyboards by running this search:
Code Block
grep -R webView *

In my case that returns the following results:

SingleViewApp/Base.lproj/Main.storyboard: <webView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xsA-nw-Njb">

SingleViewApp/Base.lproj/Main.storyboard: </webView>

This tells us that the Main storyboard has a UIWebView in it.

Copy the id of the storyboard object, in this case it’s: 

xsA-nw-Njb

And in Xcode perform a project-wide search for that value by going to Find > Find In Project… and searching for the storyboard ID.

In the returned results, click on the ID and it will take you to the specific scene in the storyboard that contains the UIWebView.

Hope this helps.