In swift, I have a tableview which consists of a contact list with emails and my goal is when you press a persons name, or I guess one of the cells, I want the email to pop up with their email in the "to recipient. I know how to do this to a button and make the button an action, but for the table view, I don't know exactly where to implement the action.
You need to implement it within the tableView:didSelectRowAtIndexPath: method of the UITableViewDelegate protocol.
As previously suggested by Cihan Tek, you need to start with implementing didSelectRowAtIndexPath. It will be executed when you tap on a cell. Inside of it you need to determine the email address and show MFMailComposeViewController. Use setToRecipients to add the email address to the "to: " field.
Related
How to achieve the UI attached in a screenshot? . I have a tableview and multi custom cells inside it.From One custom cell, while searching the name or phone number i want to display the contacts retrieved from Addressbook in that tableview itself as new view or a tableview.I dont want to navigate to address book or navigate to custom search controller. Does any one know how to implement this?
Like the screenshot attached.enter image description here
I implemented some time ago this kind of textview and solved my problem.
I think you should implement ZTDropDownTextField this is third party class, Please check below link
Note : This is only for UI like your screenshot
ZTDropDownTextField
How can I implement the login screen in the setting like the image below?
I can't find the tutorial..
What I know is grouped table view only, I want to know how to do the username and password text input like that
Its simple first TableView Cell have
UIImageView
UITextField
UITextField
The others are more simple just need to manage the click event to provide appropriate implementation.
If you want a tutorial about handling UITextFields in tableview here it is.
In my app I have a tableview filled with conversations meaning each cell has a different persons name. When i select a cell i perform a segue to another viewcontroller which has a giant UITextView displaying the message from that person's name in the cell. On this view I also have a reply button in the right hand corner and when you press it, it segues to another viewcontroller with an editable uitextview in which you can create a reply and send it.
How do i send this reply back to the original tableviewcell so that when you go back to the original tableview and click on that same conversation, you will see your reply?
In your tableview you should be displaying an array of a certain custom data object, say Conversation. In your Conversation object you could have a property NSString *latestMessage. So, when you navigate to the conversation and reply to the previous message, you update the latestMessage property to be your reply, which updates the Conversation object itself. Then, when you navigate back to the tableview it should re-display all of the Conversation objects in your array, which displays the updated Conversation. The label on the cell should be set to the latestMessage object of the Conversation instance.
Currently i show the first 100 users in a tableView Controller that leads to a User Profile if a person taps on it. But now i need to add a SearchBar so i can take the text they want and make a GET Request with the subjects and Rate of the user and get that response and repopulate the TableView.
Any Ideas how i can do that? I'm new on Objective-C and XCode making iOS apps. So please be patient. Thanks in Advance.
Note: I Don't need to search on the results i just need to repopulate them, because on internet i've found many tutorials based on searching existing table cell information.
The SearchBar has a textField inside , Which means it conforms to the UITextField delegates.
One such delegate is , - (void)textFieldDidEndEditing:(UITextField *)textField;
Set your searchBar delegate to self and implement this delegate.
When the user finishes typing this method will be called.You can extract the text from the textField parameter. Generate your URL setup an NSURL asynchronous connection with the URL.
In the Completion handler of this NSURL connection update the datasource of your tableView and called [tableView reload] on the main thread.
I have a UITableViewCell that displays person's name from Address Book. When that cell is selected, the person's info is displayed using ABPersonViewController (where editing is ON).
What I want to do is if the person's first name or last name is edited then update that information in the main UITableView.
Is there any Notification or delegate which I can use to convey that information has been updated ?
I couldn't find anything on this so I just reloaded my table.
It would be great if someone can suggest any better solution like through delegate or something.