-
-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend IASKAppSettingsWebViewController
with data detectors to recognise links, addresses, phone numbers, etc.
#515
Comments
I agree we should implement option 1 with all data detectors enabled. If users don’t want that, they should subclass |
@futuretap Awesome, I'm working on a PR. |
While adding a Searching for this leads to https://stackoverflow.com/a/53939210/2439941, where it appears that creating the web view should be postponed to I've renamed I was not aware of
The current code of @futuretap How do you want to approach this?
|
The data detectors are just 1 example of WKWebViewConfiguration, or
@futuretap What do we want to do with all these properties? |
Regarding I suggest to enable all properties except "Can Auto-open Windows". |
@futuretap Ok, will move specific To have mutual understanding on properties, what do you mean with "enable all properties"?
|
I suggested the second option. Let’s use a reasonable default configuration. We could design it subclass friendly by implementing and calling a |
@futuretap Forgive me if I keep asking annoying questions, but the Requirement Management is always the hardest part.
Is it still option 2, or option 2 except "Can Auto-open Windows"? For the subclass feature, I prefer to create another issue, so we can focus on single tasks. Is that ok? |
Option 2 except "Can Auto-open Windows". Feel free to create another issue for subclassing. |
This will prevent a crash. See: futuretap#515 (comment)
Because the observer for `estimatedProgress` has already been fired before and set a value > 0.0 to the progress bar This bug was discovered during implementation of futuretap#515
@futuretap I still have some questions about option 2, after reading the iOS docu. UPDATE |
Of course you’re right, I agree. I'm confident you’ll choose a sensible configuration that makes sense for most IASK users! |
@futuretap This is the set that I came up with: It has been validated on several pages, to check the data detectors and media behaviour. Please review and let me know any desired changes, or if I can mage a PR. |
Looks good, thanks. Let’s just extract the web view configuration into a separate method that is included in the .h file, for easy overriding. |
Unfortunately
It can only be assigned as initialiser of self.webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration]; So we should assign a method to the .h file, that's why I wanted to open a new ticket for that. |
That’s why I propose to extract the whole code to assign a config to the web view into a |
@futuretap Forgive me my stupidity, but how would an IASK user call Background: I'm not a pro in subclassing or other complicated tricks. Especially when I turn off my developer hat and put on my user hat, as a user of 3rd party libs I prefer simplicity and ease of use. An alternative to a method |
A user would create a subclass of IASKAppSettingsWebViewController and override the
|
Still not clear to me. Let's say a user wants to disable JavaScript. configuration.defaultWebpagePreferences.allowsContentJavaScript = NO; How should he do this in this proposed override method and how will that be effectuated inside the *.m file? |
The user would then copy the original implementation of |
I don't know the opinion from other programmers. But in my 15 year of iOS programming I have never ever done this. In theory; every time a user would update IASK, he should remember to verify the original implementation of To me, this is an unacceptable and unreliable workflow, where the risks are larger than the benefits. In other words; bad practise. Can't we just add a property to |
I have upgraded IASK from version 3.8.0 to 3.8.4 in one of my production apps.
It contained a self made WebViewController with a XIB file with a
WkWebView
in the storyboard.This has now been replaced by
IASKAppSettingsWebViewController
and I noticed a difference:WkWebView
shows hyperlinks at street address and phone numbers ✅:IASKAppSettingsWebViewController
does not ❌:It appears that it occurs in
WkWebView
, since thedataDetectorTypes
property ofWKWebViewConfiguration
is by default set toWKDataDetectorTypeAll
in the Storyboard file:Although this is no bug at all, we could easily extend
IASKAppSettingsWebViewController
with a new feature where these data detector(s) to assist users with convenient navigation. Especially since these links will be handled by system apps.@futuretap The question is whether you want to add this feature or not. And if so, how to implement it?
I'd like to propose 3 suggestions:
IASKAppSettingsWebViewController
IASKAppSettingsWebViewController
, which switches between no data detectors (default) and all data detectors.IASKAppSettingsWebViewController
where multiple detector types can be added, defaults toWKDataDetectorTypeNone
.I would prefer option 1, since I can't think of a use-case where I should disable these user-oriented conveniences. And also since this is the default
WkWebView
configuration when adding it to a view in Xcode.But maybe we can ask other IASK users for advice?
The text was updated successfully, but these errors were encountered: