My iPad app collects some user data, including name, address, phone, etc. I have a button that allows the user to create a new contact from this collected data.
Right now, my code creates a contact record (ABRecordRef) and sets some values (ABRecordSetValue). All the sample code I've found for the next step creates an ABUnknownPersonViewController and presents it in the existing navigationController.
I can get this all to work, but I don't want to use the navigationController, however when I present this in a modal view I don't know how to detect when the user has finished adding the contact once the Contacts page is shown. As well, I don't know why there are so many screens involved--I would like them to just hit my button and voila; the data is added as a Contact.
So, some questions:
Do I need to present an ABUnknownPersonViewController or can I bypass all of that and just write the data out to the Address Book?
If not, can I at least bypass one of the two screens presented (after the ABUnknownPersonViewController screen, a Contacts screen with edit ability is presented)?
If I present the ABUnknownPersonViewController in a modal view can I detect when the Contacts page is finished so I can remove the view?
Thanks!
erdekhayser's comments put me on to the Apple docs which led me to this post here: How to add new contact to iOS Address Book?
This appears to be a good example of how to do this programatically.
Related
The iOS UIActivityViewController overlays existing content as a stack. It is customisable but is there a way to move its position entirely and embed it inside another view.
Say I have a list of the user's contacts whom use my app. When clicking on one of those contacts, instead of overlaying the ActivityView, the contact would expand (accordion) and reveal certain elements of the ActivityView to allow user sharing.
I appreciate that this can be done by writing a custom Activity View however, unless I'm mistaken, there is no way to ascertain whether the user has certain other apps installed to allow sharing via WhatsApp or Messenger for example.
I'm coming from react-native where you can write IOS apps using JavaScript. There's a module called redux (I believe many people know it) where you can store your app state and every single view controller (component) will get notified & updated if the state changes. I wonder what's the swift approach to achieve this?
Here are some scenarios that can help you understand my question:
A user changes his profile picture in the app, then every screen that displays the user's account info will get updated so that the new profile picture is displayed
Imagine an app for sharing articles. Each article has tags that represent the categories of it. Your app has a tab bar with each tab being a category like this:
There is an article whose tags include both "Pets" and "Family" and therefore, this article is displayed on both "Pets" and "Family" screens. A user presses the heart button of the article on "Pets" screen to like this article and switches to "Family" screen to see the exact same article. The heart button of the same article on "Family" screen should also be activated
I wonder how this can be done in swift?
I have been working on app which needs phone contacts,i am able to get the name and phone numbers from the AddressBook.
But want to make tab like whats app has done,they open the default Address Book with icon of whats app in in front of contact number if the user is available on WhatsApp and also the status of the contact person.
How does the WhatsApp add icon to the number and add status to their contacts tab?
Also i am confused whether the contacts tab in WhatsApp using default UIAddressBookController or they made custom.
For more clarity please check the screenshot that i have added.
Kindly suggest me how can i achieve this in my app using the default ABPeoplePickerNavigationController.
I am pretty sure that this is a custom view controller that mimicks the original detail view of a contact. It looks similar but is still different. There is no "groups in common" or status or whatsoever in the standard detail view. Also, this is a standard system component that you can and should not override.
They will probably be using the API to access the Contacts and present them in their own view controllers.
I have made a resume maker app in iOS. It only has two fields for the work experiences. However, a user can have more than one experience and the number is uncertain. So, my app is restricting a user to enter the information for only two work experiences. Now my boss wants me to add a button and when I tap it one more field should be displayed for the experience. So, this will allow a user to add as much experiences as he wants. I have searched a lot about it but couldn't find anything helpful. If you can kindly lead me to any resource or just give a demo.
One approach you can do is to have a UITableView and have each single experience populated in each cell. Then when an add button is pressed, a view like UIPopover can appear and let the user fill out the info. After the form is filled, one extra cell would be generated to display the new experience. This approach works with deleting as well.
I am very new to this area of iPhone app development and have been looking through some links to understand it.
The requirement of my app is very similar to a phone contacts app.
I need to have a TableView on my home page with a few names on it. Whenever a name is clicked, it should open up another TableView with has further details (like mobile phone number, home phone number etc.).
I have been able to create the first TableView with the name of people but am unable to create the 2nd one and link it with the first one. I am using Storyboards to achieve this.
Also, if there is some free source code available for such an app, then that will be great!
you can add
[self performSegueWithIdentifier:#"segueName" sender:self];