Customize 'Copy' text popup (UIWebView)? - ios

I'm trying to customize the user text selection behavior in a
UIWebView. Currently, when a user highlights a region of text in a
UIWebView the 'Copy' action sheet appears, allowing you to copy the
text. I would like to perform some custom action on text selection,
effectively replacing the 'Copy' dialog, or adding another option to
the list of options (e.g. 'Copy' | 'Search').
My question is: Is there any Apple-accepted way of doing this? I'd
prefer not to put my app approval in jeopardy, so doing this by the
book is ideal. I've seen similar questions asked about this topic, but
all remain unanswered. Can anyone provide some insight on how to
accomplish this?

The popup you refer to is called a UIMenuController. You can access the [UIMenuController sharedMenuController] method to get the menu controller. You can then add your own UIMenuItems to the menu controller, and these can be shown contextually, using the canPerformAction:withSender: method on the UIWebView. For more info, refer to the iOS Developer Reference on UIMenuController

Related

Is there an extension that will define or briefly explain any particular method, attribute, or tag on hover or right click?

Is there an extension that will define or briefly explain any particular method, attribute, or tag on hover or right click?
when typing code such as
nameLog = nameLog.toLowerCase();
.toLowerCase() being the method
is there any editor or extension that would allow me to right click on the method and quickly describe what it is?
another example: If I wanted to know what this tag was used for I could click or right click for a description.
Basically I want to be able to learn about the code I am typing as I am typing it or right after I copy it into my document or type it.

What is this 'block' called in a UITextView?

I am looking at creating a contained block like in the notes app Bear. When you click the ‘hashtag’ icon in the Keyboard Accessory it adds a ‘contained block’ in the text view. You can then continue to write text but if you backspace it selects the whole block as if it’s a single element? It also shows it with a background colour. When you click the tag icon what is that ‘contained block’ element called? Here is the example: https://imgur.com/a/kpcK5En
That's definitely a custom view.
I searched their site for 3rd party libraries but can't seem to find the specific one that does this behavior. Tbf, I just skimmed. But there's a possibility it could be their own code.
3rd-party libraries used: https://bear.app/faq/Extra/Libraries%20used%20in%20Bear/

how to implement non-modal dialog in IOS like this (image attached)?

Question: How would one best implement non-modal dialog in IOS like this (image attached)? Allow ability to drag move map still and select (long press) another location, which then that detail is populated in the pop-up "non-modal" dialog. Dialog can have ability to "delete" / "add to favourites" etc.
To clarify:
I'm asking how to implement the dialogs in the image I have marked "Non Modal Popup"
so for the iPad/horizontal regular case, I'm highlighting the dialog would be associated with the ViewController on the right, so therefore in this case the user could still drag the map within VC2, but also access/use VC1 as well
Some notes re my pondering:
can UIViewController.present NOT be used here as it is modal? If it can be used what settings to get this working?
it not would you recommend using an (a) separate UIViewControllerto implement, and show it up using the manual means of adding a UIViewController, OR (b) is it better to just keep it as a UIView in this case? In either of these cases one would have to do any adaption programmatically?

Use link words in a text in UITextView [Objective-C, Xcode]

I`m starting in Objective-c this Year and I found nothing that could help me in the logic of how elaborate it:
Look!
I have a UITableView with a list of drugs. When I click on any medication, I'm taken to a DetailViewController that displays the text information about this drug. In this text, I want every time a drug name appear, it appears as if it were a “link”. So when the user clicks, it will be taken to other remedy detailviewcontroller without need to go back to the list of remedies! What is the better way to implement this?
I thought about passing an array with all drugs for DetailTableView controller via Segue, and then conduct a search for any of the remedies present in the text, but i don't know how to turn that word into a link, or set a function to become part of the text (the drug name) clickable
Just to make it clear, let's assume that we are reading the details of the text on the drug called Amoxicillin:
“Amoxicillin drug works better than erythromycin”
What I want is that the name Erythromycin become some kind of link, so when the user clicks on it, is brought to the screen details about erythromycin. Do you guys understand what i mean?
P.S.: I saw that the UITextView has an option called "Links" in attribute inspector, but i have no idea how to use it or if this is for what i want
Thank you all again!!
Use UITextView And select these attribute.

jQueryUI datepicker redisplays after selection

The datepicker is managed by knockout-jqueryui in a Durandal view presented as a modal dialog. The calendar pops up when the corresponding INPUT is focussed, and hides when it is blurred. Data-binding works fine.
But when the user selects a value, the calendar closes, the INPUT updates and the calendar re-displays. It works, but it's annoying my users because they are mouse obsessed and the calendar obscures the control below, making it hard to click on it. Yes, I know they could press tab. I have pointed this out.
How can I stop the re-display? Ideally, triggers for display would be focus and keydown. I have no problem with configuring it to manual control and switching with data-bind="change: showCalendar, ..." or similar, if that's how one does this.
So, what's the usual way to go about this? If it's manual control as I describe above, what are some keywords to expedite finding the relevant section(s) in the documentation? (How to set it to manual and how to hide/show it manually.)
(I found show() and hide())
The showOn option for jQuery UI Datepicker is passed through by knockout-jqueryui.
It defines only two values, 'focus' and 'button'.
There is no explicitly defined mechanism to disable auto-display, but I found that a value other than the defined values has the desired effect. I am passing 'click'.
Manual control methods are show and hide.

Resources