custom mail composer just like Three20 Message Composer - ipad

My team is trying to design a mail client for lotus notes on iPad. Before we start I want to know if there is a third party custom MFMailComposeViewController available. It should have To field just like Three20 MessageComposeViewController (with the email address entered in round blue box). I want the same for Cc and BCc.
Not sure how I could extend the Three20 MessageComposeViewController to add Cc, Bcc and use their delegate methods to send email request to my server.

It is perfectly doable. I have subclassed TTMessageController before and added some image views to it, but from my experience it its not wise to go down that route. TTMessageController really isn't designed to be subclassed. So if I would do that again, I would copy TTMessageController and would edit it directly.
I don't know any other projects that provide this kind of UI. Are you using Three20 in that project anyways? Then TTMessageController might be a good fit. If you are not planning to use the rest of the library be warned: TTMessageController is quite deeply rooted in Three20. Ripping it out would be a pain. Rewriting from scratch might be easier.
About your question of how one could integrate CC and BCC fields into TTMessageController, that is hard to answer without a concrete question. I could only give some hints where to look.
To start the "To:" Field is a TTMessageRecipientField. You might what to add additional fields of that class to the MessageController. A TTMessageRecipientField contains a TTPickerTextField through composition. The picker Text Field is the one that really does the work by communicating with the data Source of addresses, which simply is a TTTableDataSource and by displaying the blue bubbles (TTPickerViewCell).
I hope that gives you an rough idea and some code to study.

Related

Adding and deleting contacts as a singular object package (like in Facebook messenger)

The problem I have had with this is just being able to type what I mean in few enough words to find anything meaningful in the internet.
This is what I want (sorry for the low quality image):
Search through a list of contacts, when you click on they are added as a contact package instead of a long name string. If then we click delete next to it then the whole contact is removed. This is the system used by most chat and txting services for adding contacts.
I am hoping that there will be a good github library online or, failing that, that someone can suggest the best way to proceed coding it myself.
Having thought about it somewhat I would think that I would want to treat the object a bit like I would an emoticon. Although it looks like a much longer word we would allocate a string package to the user which when detected would look up their name and output their name in the bubble. If we delete any of the string package then the whole thing becomes void and is deleted.
This is all much easier said than done of course.
So this question is trying to ask two main questions:
What is this actually called (this would be a great start to enable me to get more than 0 search results)
Is there a good github or online library that deals with this, if not then any advice on how to do it manually would be great
Thanks :)
I looked through lots of different libraries which enabled this. The problem about git hub libraries is always that you have to compromise between the one which is the best and the ones which are getting updated and have recent activity.
The one which I settled with and is working out excellently can be found here and is called the VENTokenField
If this link is broken then just search in google for VenTokenField and it is the github library by venmo.
I found it very easy to use:
Add the delegate to your header file: VENTokenFieldDelegate
Create a property in the header file too:
#property (weak, nonatomic) IBOutlet VENTokenField * _tokenField;
I then found the easiest way to set it up was to add a UITextField to the XIB file and class it as a VenTokenField. (don't forget to set the constraints to enable the tokenField to get bigger so constrain the uitableview to the bottom of the field)
Then you just need to link in your search logic but as this is a question about the library and not the code I won't go into it here.
Hope this helps and comment if you are struggling and I'll try to update the answer to make it more comprehensive.

How iOS Google Now can show different card template

I wanted to know the technology decision behind the iOS Google app.
As we can see, in the app's Google Now feature it renders many different card templates for different scenarios, and those templates seems to be very flexible based on server inputs.
I was wondering if this is implemented all based on HTML5? or they just have many templates built in and render them locally? I'd vote for the HTML5 route but not sure if this still involved some native code to make it more responsive?
Thanks!
As we (well, most of the community) are not Google employees we can't tell you what they really did, but I'd say that it is possible to do this dynamically in the app.
We did develop something similar that responds to definitions sent by the server and transforms them to custom designed forms following basic rules.
Google reuses the design of those cards for different plattforms, the easiest solution should be showing some WebView and using HTML5.
I agree with Kevin, as this answer is entirely based on personal opinion, too.
The way I would go is to create a card class which will load some JSON data and format it with HTML and CSS. Looking at each card it would be hell to format things that way natively. I mean, attributed strings is not the way to go. Too much logic for deciding which card get a bigger text or a picture.
Additionally, the top header is most likely "localized" as well, so you get the location and load a localized image. But that is Google by nature.

Web Source into NSString

How could I access a website and turn components of the website into strings. For example taking information from Facebook posts. I have done a little searching but can't find any good tutorials or anything useful.
Try looking at this tutorial. It should get you more familiar on the subject and start you off on the right track.
As it states at the beginning of the tutorial...
How to Parse HTML on iOS
Let’s say you want to find some information inside a web page and
display it in a custom way in your app. This technique is called
“scraping.” Let’s also assume you’ve thought through alternatives to
scraping web pages from inside your app, and are pretty sure that’s
what you want to do. Well then you get to the question – how can you
programmatically dig through the HTML and find the part you’re looking
for, in the most robust way possible? Believe it or not, regular
expressions won’t cut it! Well, in this tutorial you’ll find out how!
You’ll get hands-on experience with parsing HTML into an Objective-C
data model that your apps can use.
http://www.raywenderlich.com/14172/how-to-parse-html-on-ios

How do Google opening links in a new window without target attribute?

i wonder how google manages to open external links in a new window/tab without defining target="_blank".
For example in google plus, all external links open in a new window.
I think its some Javascript voodoo but the .js code is obfuscated so i cant really look into.
edit: oh and followup question: why?
Using a framework makes this easy. Just have JavaScript look for links marked rel="external", or another identifier that shows them to be an external link, and dynamically add target="blank". Here's an example using Prototype:
$$('a[rel="external"]').each(function(a) {
a.setAttribute('target', '_blank');
};
It's not beyond reasoning for them to add the target attribute by javascript before allowing the anchor link event to return true.
It's Javascript. You can say:
window.open('http://example.org', '_blank').focus();
But please, don't. Opening links in new windows is almost always the wrong thing to do. Seriously, good uses of this are vanishingly few. If users want a link opened in a new window, they are quite capable of doing that themselves.
Jakob Nielsen was telling people this twelve years ago. Others have taken up the cudgels. The W3C removed the target attribute from HTML 4 because it was such a bad idea. I honestly don't understand how this usage persists. Don't you find it incredibly annoying when a website does this to you? Why would you want to write a website which does this to someone else?
Which brings me to your followup question. Why did Google decide to do this? I have no answer to that, and i am completely and utterly baffled how one of the very biggest, brightest, web companies could make such an elementary mistake. But then, a lot of the Google Plus interface has very poor usability (as in, mostly worse than Facebook poor); i suspect there is an interesting story behind it. Was the project under-resourced, and thus built cheaply on top of a rapid development framework such as GWT? Was it built as a spare time project by a lone wolf with a blind spot for web architecture? Was it driven by strategy wonks who didn't care about getting the technology right? Mystery.

How to get rid of stupid "pad" labels produced by RTML functions?

I am unlucky to be in charge of maintaining some old Yahoo! Store built using their RTML-based platform.
Recently I've noticed that HTML code generated by some RTML functions is sprinkled all over with "padding images" (or whatever is the conventional name for those 1x1 pixel images used to enforce layout). I have nothing against using such images, but... all those images are supplied with an ALT attribute like this:
<img href="http://.../image1x1.gif" alt="pad">
With all due respect to the original authors of RTML, but they must have been smoking something when they came up with this "accessibility enhancement"... :-(
Anyway, here are my questions:
Does anybody know a list of all RTML functions that generate HTML with all these "pad" images?
Is there any way to get rid of all those alt="pad" attributes without rewriting a lot of RTML code?
NB: This may sound a little cynical, but improved accessibility is not the main goal here. The main goal is to stop exposing those moronic alt="pad" attributes to Google and other smart search engines. So client-side scripting is not going to help, as far as I know.
Thank you!
P.S. Probably, most of you are really lucky and never heard of RTML. Because if somebody would establish a prize for software products based on
commercial success
------------------
usability
ratio, this RTML-based "platform" would probably win the first place.
P.P.S. Apparently someone from Yahoo! finally listened, because I can no longer find those silly "pad" tags in the RTML generated for our store. Nevertheless, one of the ideas offered in response to my original question does provide a very practical solution - not just to the original problem but to any similar problem with RTML platform. See the winning answer - it's really good.
The only way I see is to have your own website front-end that will filter whatever you want from the RTML site....
for example, your rtml site is at http://rtmlusglysite.yahoo.com/store/XYZ01134 , you could host a simple PHP front-end at http:://www.example.com that would be acting like a "filtering" HTTP web proxy, so http://rtmlusglysite.yahoo.com/store/XYZ01134/item1234.rtml would be accessed by http://www.example.com/item1234.html
It's not an ideal solution, but it should work, and you could do some more fancy stuff.
Nice try from the other posters, but there is a very simple RTML command that will do it. . .
TEXT PAT-SUBST s GRAB
MULTI
HEAD
BODY
TEXT #var-with-alt-tag-equals-pad-in-it
frompat "alt=\"pad\""
topat ""
The above RTML will find all instances of alt="pad" and replace it with nothing.
Well you're right on RTML being relatively untraveled :)
Do you have a way to add your own attributes to these images tags? If so, would it be possible to override the alt attribute? If you specify alt="", I would think that would override Yahoo's... Otherwise consider putting a useful alt tag in there for the blind and dialup types.
It's the first time I'm hearing about this platform, but here is an idea: if you can add javascript to the pages, you could write a function that will run after the page has loaded and remove all the alt="pad" attributes from the page.
Unfortunately this solutions works only with browsers that know about scripting, so lynx or some other text based browsers might not support it.
I have shared a link official RTML guide from yahoo. Hope it will help. Thanks!
List of available RTML books and resources

Resources