parent
aabd56b23d
commit
bd343f6971
|
@ -328,6 +328,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
// Not actually a "new" contact, but this brings up the edit form rather than the "Read" form
|
// Not actually a "new" contact, but this brings up the edit form rather than the "Read" form
|
||||||
// saving our users a tap in some cases when we already know they want to edit.
|
// saving our users a tap in some cases when we already know they want to edit.
|
||||||
contactViewController = [CNContactViewController viewControllerForNewContact:cnContact];
|
contactViewController = [CNContactViewController viewControllerForNewContact:cnContact];
|
||||||
|
|
||||||
|
// Default title is "New Contact". We could give a more descriptive title, but anything
|
||||||
|
// seems redundant - the context is sufficiently clear.
|
||||||
|
contactViewController.title = @"";
|
||||||
} else {
|
} else {
|
||||||
contactViewController = [CNContactViewController viewControllerForContact:cnContact];
|
contactViewController = [CNContactViewController viewControllerForContact:cnContact];
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
- (void)didFinishEditingContact
|
- (void)didFinishEditingContact
|
||||||
{
|
{
|
||||||
DDLogDebug(@"%@ %s", self.tag, __PRETTY_FUNCTION__);
|
DDLogDebug(@"%@ %s", self.tag, __PRETTY_FUNCTION__);
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:NO completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - CNContactViewControllerDelegate
|
#pragma mark - CNContactViewControllerDelegate
|
||||||
|
@ -163,8 +163,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
- (void)contactViewController:(CNContactViewController *)viewController
|
- (void)contactViewController:(CNContactViewController *)viewController
|
||||||
didCompleteWithContact:(nullable CNContact *)contact
|
didCompleteWithContact:(nullable CNContact *)contact
|
||||||
{
|
{
|
||||||
DDLogDebug(@"%@ done editing contact.", self.tag);
|
if (contact) {
|
||||||
|
// Saving normally returns you to the "Show Contact" view
|
||||||
|
// which we're not interested in, so we skip it here. There is
|
||||||
|
// an unfortunate blip of the "Show Contact" view on slower devices.
|
||||||
|
DDLogDebug(@"%@ completed editing contact.", self.tag);
|
||||||
|
[self dismissViewControllerAnimated:NO completion:nil];
|
||||||
|
} else {
|
||||||
|
DDLogDebug(@"%@ canceled editing contact.", self.tag);
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - ContactsViewHelperDelegate
|
#pragma mark - ContactsViewHelperDelegate
|
||||||
|
|
Loading…
Reference in New Issue