Prevent Autocorretion of a Word in Swift - ios

My client's chat app is autocorrected whenever it is mentioned in UITextViews within the app.
So if it's called XYZ (just making this up) whenever users type XYZ in a UITextView in the app, it tries to autocorrect it.
I know this is a small/petty thing, but he feels like it's embarrassing to see the app's name try to be changed for users of it, if that makes sense.
Any chance I could have that specific word ignored for the UITextView inside the actual app? Or does this require modifying the user's SwiftKey or something on a per-user basis to avoid?
Thanks for any help / direction anyone can provide!

A very well documented tutorial about UITextChecker given by NSHipster blog.
You should focus on the Learning a New word Section of the blog, which should give you answer
Just for the sake if people don't want to jump around links
Let’s assume that you want your users to be able to type "xyz"
exactly. Let your app know that by telling it to learn the word, using
the UITextChecker.learnWord(_:) class method:
let someNewWordTheAppNeedsToLearn = "xyz"
UITextChecker.learnWord(someNewWordTheAppNeedsToLearn)
I believe you can create a wrapper class exclusively for making app learn words and call it in your app delegate.
Apple Documentation

You can use UITextChecker in the root view controller's viewDidLoad()
UITextChecker.learnWord("xyz")

Related

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?

Old app headers into newer app version? [Jailbreak Tweak]

Sorry, for the confusing title. I am developing an iOS Tweak (for jailbreaks)
What I am trying to accomplish is something I haven't seen people do before but I am sure it is possible!
as an example lets say I am trying to change my username.
in app version 1.0 in the User.h there is a method called
- (void)setChangeUsername:(id)arg1;
which allows the change of usernames within the app, now on app version 1.2
the method is rendered useless / isnt there.
how could I reactivate this method so it allows the change of usernames?
would I have to edit the app binary, or import some old headers, not even sure what the first step of this process is, or if its even possible.
Sorry for the vague example but I hope it is enough information to get what I need answered!
If you would like more information I would be happy to write some more and be more detailed :)
Thank you!
You can't call or hook a function that no longer exists. If you want to change the username you will have to find an alternative method to do so.

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

creating facebook style timeline in ios sdk

I am trying to creating something similar to facebook timeline in facebook website. I tried searching for some examples I could not find any. Can anyone give me pointers on how to get started if I want to create one or an existing example would be great.
Thanks
Not an answer, but a pointer, If you'd thinking to make something like here, then its kind of tough and really need presence of mind to make it. First of all, source code is only avail with Mark Zuckerburg so in case you can ask him for that. If he'll deny, you should go ahead and,
Think of it, design of it, and start making it.
You need to make mocktail of UITableView's, UIImageView's, extra UILabel's and UIButton's for garnishing and test, and a well looking design that says yes its timeline.
Once you done with above, you need some test data, with a date inside it, perform descending sort with NSSortDescriptor. Update your timeline with those data you've. You've to check for the kind of data you want, or you've included. Set the layout as per the data you want to show.
and you'll say, Whoa! I've own timeline.

YouTube's search function in IOS

http://coolappsman.com/wp-content/uploads/2012/09/YouTube-App-Search.jpg
Hello, I am looking for some implementation tips for YouTube's search-function. I want to implement exactly the same thing but without the function "displaying tips based on the search-term".
With other words, I want a simpler version. How can I make the NavigatorBar disappear when the user clicks on the "search-button" and then make the NavigatorBar appear again after the user searched what they looked for? If you have seen the app its pretty clear what I am trying to explain.
Anyone know a good tutorial to implement something like this? What methods do this require? I am grateful for all tips. Thanx!
Jesper.
Concept you want to implement is quite hard to do, that is highly customized control. Instead of showing results in the same view, a new controller is pushed with results table.
However, you can start with UISearchDisplayController. See Apple's TableSearch example.

Resources