iOS 8 Today Extension: Is it possible to add editable text field? - ios

I am trying to create a simple Today Extension. I was able to add a label wherein the value can be updated via the main app. Now, I am exploring the possibility to update the value in main app via the extension. However, when I tried to add a textfield, I cannot input anything.
Is this a limitation of the extension? If not, can you please guide me how to accomplish this? Thank you very much!

Unfortunately, it is a limitation.
It says in Apple's extension programming guide:
Because user interaction with Today widgets is quick and limited, you should design a simple, streamlined UI that highlights the information users are interested in. In general, it’s a good idea to limit the number of interactive items in a widget. In particular, note that iOS widgets don’t support keyboard entry.
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Today.html#//apple_ref/doc/uid/TP40014214-CH11-SW1

Related

How UIActivityViewController title and description works?

How the title and description parts of the header on UIActivityViewController works by default on iOS and other platforms? In cases, where there's no customization and any other works done to set them, how these 2 elements are generated by the system.
There can be multiple scenarios according to the type of element that's being shared and their related attributes. So, understanding this default mechanisms of the system requires trial and error attempts to figure them out. It would be better to have a common system design of it.
For iOS13+ it is possible with LPLinkMetadata for UIActivityViewController. Check this tutorial for full info: Composing Rich Link Previews Using LinkPresentation in Swift

How do I export text from iOS Notes app to my app?

I know this is possible and is something many big apps do, but I can't figure out among UTIs, extensions, UIActivityTypes, etc. which spell I need to use for this in particular. I'm trying to add my app to the list of apps that appear when you hit the export button in the Notes app on iOS because I want to be able to take a bunch of text inside a note and repeatedly and safely send it into my app.
I want my app to appear in this list, exporting directly from Notes. There appear to be duplicates of this question that are very old claiming that "exporting from Notes app is not possible for third party apps", but I think they're either now wrong or answering a different question because as you can see in the above screenshot, Messenger is plainly able to do this.
It does not look like registering UTIs gets this done for me. I went ahead and registered my app to all sorts of UTIs, but all that happens is my app ends up in popups like this one, which appears when trying to open a txt file, which is not what I'm looking for. Unless there is some other UTI that does not conform to public.data or public.content which I need to be using, in which case I'd be happy to hear it.
I used one of my allotted support requests to ask Apple, and after some time and back and forth I was able to get my answer! Here is what they said:
Your project is missing a Share app extension. Start by reviewing the
App Extension Programming Guide:
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/index.html#//apple_ref/doc/uid/TP40014214-CH20-SW1
Information specific to the Share extension point:
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Share.html#//apple_ref/doc/uid/TP40014214-CH12-SW1
You don’t need to register the text content type in your
CFBundleDocumentTypes. as you’ve done in your sample. However, you
will need to provide an activation rule for the extension point, such
as the one shown in this section of the document (the section titled
Declaring Supported Data Types for a Share or Action Extension):
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1
See specifically the predicate example that activates the extension if
an attachment with the com.adobe.pdf UTI is present. You will need to
do something similar, to cover the UTIs for content you would like
your share extension to consume. As a starting point, you can consume
text with the public.text UTI. For more common UTIs, please see this
document:
https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1
I also found the bits about providing an activation rule to be super confusing, and this answer helped that: How do I set NSExtensionActivationRule predicates?

Build an xcode text to speech application

I am building a project that involves creating a mobile app in xcode. The idea is that a user can click a button/menu item and the app will read out what is on the button/menu item. Essentially it is an app for those who have difficulty with their eyesight and require confirmation on what has been pressed.
For example if the button/menu item said "hello there" on it by clicking the button/menu item it would read out "hello there" so the user could hear it.
As mentioned it is been built using xcode and I am aware of AVSpeechSynthesizer. All i can find online are tutorials that either translate your speech or require the user to type in what they want reading out.
Any tips on how this could be achieved?
iOS applications automatically read many screen elements when VoiceOver is enabled on your device. If you have custom elements on screen that you want it to read in a particular way, you'll need to investigate the usage of UIAccessibility.
AVSpeechSynthesizer can certainly read out whatever text you want it to, the user doesn't need to type anything in. Share some code that uses it and we can help you out.
No need for you to reinvent that wheel iOS already supports this behavior look into UIAccessibility.
For example to make a button conform to UIAccessibility you need just one line of code.
[button setAccessibilityLabel:NSLocalizedString(#"Your Name Here", nil)];
and to set a hint
[button setAccessibilityHint:NSLocalizedString(#"Your Hint Here", nil)];
hope that helps -- seems like you can take today off ;)
and if you are not sure how to use Accessibility on your device visit this link -- http://support.apple.com/en-us/HT5018

iOS: Create dynamic contracts with iOS

I want to create a native ios application where people have to sign different contracts. Each contract contains text and input fields such as drop down and textbox. Now each contract might have different number of input fields and these might be totally different.
Any input in the best way to solve this problem? It seems like a lot of work to dynamically generate UI in code and reformat the contracts in a way that can be rendered by ios? As I cant send the pdf or doc itself.
One solution may be you can have categories(sector-1,sector-2 etc) and related sample contract from. In those sample forms you can handle dynamic controls which definitely a few.

How to add icons and more text inside Settings.bundle. Get more options

I am learning iOS development and I have some questions to ask you in my first post.
To learn iOS I do an stupid application which have Settings.bundle. I want to put small images or icons inside it but I can't.
I also write to the right of the PSChildPaneSpecifier the value of a PSToggleSwitchSpecifier
Apple does it, see the image:
I search in NSUserDefaults Class Reference but I didn't find anything about this. Maybe it is impossible and only Apple can do.
You're right, it's something only Apple can do. Third-party apps are limited in what they can achieve in the settings bundle. The only icon you can have is the app icon on the first page, and the only information on the right hand side will be string values - see here for details.
Without being jailbroken you cannot achieve this, Apple simply won't allow it and does not offer a way to do this.

Resources