How did twitter implement new autocomplete feature in iPhone app? - iphone

Twitter has an awesome new way to enter "#" and "#" in the latest iPhone app.
http://blog.twitter.com/2011/03/twitter-for-iphone-ipad-even-better.html
When you type "#" or "#" and then type characters it instantly starts to autocomplete in a table below. How are they doing this? It feels native, but is it?
If it's native, how did they do it? UITextView with an active UITableView? It's really fast and smooth, so I'm guessing they load the phone with trending #'s and your #'s and it's fast because the data is local (it goes to just typing if it's not there).
But I'm wondering if there was a way to achieve this affect with data that is remote on a webserver using async calls.
Any thoughts on how to do this / get started?

If by 'native' you mean, build into the SDK, then I have to disappoint you, this is not a build-in SDK feature (there is something similar with the UISearchController/UISearchBar classes, but that's not what Twitter is leveraging).
This however, does not mean that you cannot build it yourself. I believe it would be quite simple. All you would have to do is monitor every time the user inputs text into the UITextView (this can easily be done using the UITextView delegate methods). You do a check on all the text, and if the user enters an '#' or a '#', or any other symbol you want to watch for, you create/show a UITableView beneath the text view (or wherever you want it).
As for the table view's datasource, it would have to be based on information you gather through search. When Twitter shows you a list of trending tags, etc. I would think it is something they have pulled down when you synced your feed, and then cached somewhere. If you were using a web server, you could do the same. When the user starts entering specific text, you could do a search on the server. If you do the network requests asynchronously, you can display a UIActivityIndicator in the table view, until you've gotten a response from the server. If the user enters more text before the server has 'replied' to you, simply cancel the old server request, and start a new one.
I haven't implemented something like this myself, and I have no knowledge of how it would perform in real-life, but if I was to implement something similar off the top of my head, this would be the aproach I would pursue. It might not suit your case perfectly, but hopefully, it will have given you some inspiration :)

Related

determining vertical vs horizontal photo in Zapier

I am receiving iPhone photos from the Sendblue messaging service and need to determine if they’re vertical or horizontal. This seems like it should be really easy but is giving me trouble. They’re in a CDN (link to example photo).
Any solution would be good, ideally it's something simple and doesn't require another app. Seems like this should be much easier than it is not sure what I'm missing.
So far I’ve tried this post and the CLI that resulted from it, but when I try to add it doesn’t show up in my apps.
I also tried the “mallabe” Zapier app, but it’s saying the photo isn't “publicly accessible”. This confuses me as the photo seems accessible to anybody I send it to.
AirEXIF is another solution I am looking into, I just applied to use their app so waiting to hear back on that front (not much activity from them recently so hoping they're still around).

UWP RichEditBox Text with Inline Rich Objects

I am working on a UWP app and I'm basically trying to do exactly what Facebook does with their app when composing a post.
Basically I want to be able to type text and At Mention someone in the RichEditBox. The person's name should be highlighted and when I tap on it I should be able to invoke a Command in my view model. Also once I hit send, I need to parse out what is text and what's a link to a person's account. I've played around a lot with the RichEditBox but can't quite figure this out.
Does anyone have any hints or ideas? I'm thinking I'll have to keep track of my object's position on every keystroke, just wondering if there's a cleaner way to do it.
You could use the RichTextBox.Document.Selection.Link property to store a custom link to your entity (ex: "mention://JohnDoe")
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.text.itextrange.link.aspx

OwnCloud enhance core features with App (eg. user registration)

I started looking into OwnCloud app development to add some capabilities I would like to my server. To me it seems like Apps can't modify anything like the Login page or User Management page. Is this the case?
I want to build a user registration app and would love to integrate it into the user management page (if not and it has to exist as its own app page not a big deal). The one big problem I see so far is not being able to add a "Register" link to the login page. I could just go in and add it to the source manually, but I would like to keep the App self contained so others can use it too.
If this is not possible to do in an App I may just need to modify the core application and then see if they will accept my feature addition in a pull request.
Thanks to anyone who can shed some light on this for me. I don't want to waste my time trying to figure out how to do it with an App on the platform if it wont be doable.
After a lot of digging around I did figure out a way to do this.
In the App's app.php file, you can force a script to be loaded if the plugin is enabled:
$api->addScript('script_name'); // without .js
In that script jQuery can be used to add the elements to the page where you need them.
This was a good solution for me since I only needed to add a single button to the login page. I can see this being a bad idea if you want to make vast modifications. At that point you might as well just create a separate page that you have full control over.

How to show a User view in GWT app by typing in browser address bar

I have this gwt app which say, runs on http://mygwtapp.com/ (which is actually: http://mygwtapp.com/index.html)
The app host a database of users, queried by searching usernames using the search view and results are shown in the user results view. Pretty useful enough. However I need to bb add a way that user view can be viewed by just typing http://myapp.com/user123
I am thinking that the question I have here, the answer is a server side solution. However if there's a client side solution, please let me know.
One fellow here in StackOVerflow suggested that the format would be like this:
mygwtapp.com/index.html#user123
However the format is important to be like: http://myapp.com/user123
The 'something' in 'http://host/path#something' is a Fragment identifier. FIs have a specific feature: the page isn't reloaded if only FI part in URL changes, but they still take part in browser history.
FI's are a browser mechanism that GWT uses to create "pages", i.e. parts of GWT application that are bookmarkable and have history support.
You can try to use an URL without # (the FI separator), but then you will have a normal URL, that reloads the page with every change and it could not be (easily) a part of a normal GWT app.
mygwtapp.com/index.html#user123
That would be using the History mechanism (http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsHistory.html) which I would add is the recommended way of doing it.
However, if you insist on using something like http://myapp.com/user123, one of the possible ways is to have a servlet which accepts this request (you might have to switch to something like http://myapp.com/details?id=user123). The servlet will look up the DB and return your host html back. Before returning it will inject the required details as a Dictionary entry in the page (http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/i18n/client/Dictionary.html) On the client you can read this data and display on the UI

iPhone SDK: Ideas on how to implement a help facility for application

We we wondering what are some ways developers have added a help function to their apps. What are some techniques people have used?
One way we were thinking of is to us UIWebView to display a HTML file with help instructions.
Thoughts appreciated.
I'm using UIWebView right now which pretty much contains all the help in a single page, along with some JQuery things to display popups, etc. But I like the way iCab Mobile (et al.) are doing things which is a sectioned UITableView with each row a separate topic or section within their overall help information (complete with icons...) then in their bundle they have each section in its own html file, organized by localization.
Another thing in my queue for the next release is to provide a dynamic "News" view. The rough idea is as follows... I have on my server a file or CGI where I can place small bits of news I'd like to push out to users. On startup, my app checks for network availability and if present, start a thread to see if anything has changed on the server since last updating the News data. If changes present, post an alert letting user know, and asking if they'd like to read it now. At that point, the latest news is already downloaded and cached, so they can simply read it later if they want, and I won't post anymore alerts until the server file changes again. (And one could add a preference/setting to disable these alerts.)
I'm thinking this would be a good way to let people know that some nasty bug is known and fixed and an update is sitting in the queue, solicit beta testers, promote upcoming features or other apps, etc. I can see where constant alerts everytime I've got something new to promote would get annoying, so having a setting to disable them means the user never has to read them unless they want to. Although some kind of override to warn of recently discovered/fixed bugs seems sensible.
FWIW, the author of Mover+/Mover has just started doing a similar thing, though I think Emanuele is perhaps only showing one Notelet at a time, whereas I envision a bit more of a history (shown in UIWebView) until I decide to age stuff off the bottom of the stack.
I'm using a scroll/page view to show several images containing small notes. Each image then tells the user about the more advanced functions on a specific part of the app.
In my opinion the help should only contain information that isn't a 100% relevant for the use of the application. It should be things the advanced user should use to make more use of the app. It should contain gold for the power users. The "basics" should be so obvious that no help would ever be needed. If that's not the case, I think, you've failed as a developer on the iPhone platform.
(Here's a screen shot from my demo app)
I'm currently creating a fairly complicated app. I'm thinking of doing help as a semi-transparent overlay - help in text form is hard to swallow for users; it's much more helpful to just point at stuff and say "this does that".